Adding layers

From TOI-Pedia


Introduction

When you first open the QGIS interface, the map canvas will be empty. In order to view items on the map, you will need to add some layers to the project. This tutorial will explain the basics of adding vector and raster layers to the map.

Related tutorials:

Background

Vectors and rasters are the two main types of data supported by GIS (Geographic Information Systems). Vectors represent geospatial data as geometrical shapes. Vectors can either be polygons, lines or points. Rasters, on the other hand, are made up of pixels rather than discrete geometrical shapes and are basically any type of digital image. For example, digital aerial photographs, satellite imagery or scans of maps. The differences between the two data types mean that vectors are generally better for representing discrete features, while rasters are better for representing data that varies continuously such as elevation or chemical concentrations.

Vector vs. raster data model


You can see whether layers in a project are vectors or rasters by looking at the symbol next to the layer's name in the layer list on the left of the QGIS interface. Rasters are symbolised by a checkerboard pattern. Vectors are symbolised depending on their geometry type: polygon (square with solid fill), line or point.

Adding layers: drag and drop method

The quickest and easiest way to add any type of layer to QGIS is by simply dragging the file from its computer folder and dropping it onto the the QGIS interface.

QGIS addlayer.gif

The more "official" methods for adding vector and raster layers are explained in the following sections.

Adding vector layers

This part of the tutorial will show you how to add a vector layer to your project. The most common file formats for vector data are: GeoJSON, GeoPackage and Esri Shapefile. This example will show how to load a GeoJSON file into QGIS, but the procedure is the same for any other vector file format.

  • Step 1: Obtain the data. In this example we will be loading a dataset from the city of Amsterdam into QGIS. If you want to follow along, download the GeoJSON file from the following site: https://maps.amsterdam.nl/open_geodata/?k=253.
  • Step 2: Open QGIS and navigate to Layer » Add Layer » Add vector layer.... Alternatively you can click on the "Add vector layer" button in the side toolbar.
Step 2: Add vector layer via QGIS menu
Step 2 (alternative): Add vector layer via side bar button

























  • Step 3: Choose the file path of the data you want to add to the project using the "browse" button.
Step 3: Add vector layer pop-up window - browse to data location



















  • Step 4: Click "add" and you will see the layer added to the layers list and the data displayed in the map canvas.
Step 4: Vector layer added to map canvas

Adding raster layers

This part of the tutorial will show you how to add a raster layer to your project. The most common file formats for raster data are: GeoTIFF, JPEG, Esri ASCII. This example will show how to load a GeoTIFF file into QGIS, but the procedure is the same for any other raster file format.

  • Step 1: Obtain the data. In this example we will be loading a dataset from the PDOK website into QGIS. If you want to follow along, download the GeoTIFF file from this site by selecting a grid square on the map and clicking "download".
Step 1: Download data used in this tutorial from this site
























  • Step 2: Open QGIS and navigate to Layer » Add Layer » Add raster layer.... Alternatively you can click on the "Add raster layer" button in the side toolbar.
Step 2: Add raster layer via QGIS menu
Step 2 (alternative): Add raster layer via side bar button
























  • Step 3: Choose the file path of the data you want to add to the project using the "browse" button.
Step 3: Add raster layer pop-up window - browse to data location



















  • Step 4: Click "add" and you will see the layer added to the layers list and the data displayed in the map canvas.
Step 4: Raster layer added to map canvas

Layer ordering

The order in which layers are shown in the layers list is the order in which they will be displayed on the map. In other words, layers higher in the list will be shown above layers lower in the list. Layers can be reordered by clicking and dragging them to the position you would like in the layers list panel.

In the example below, there are three layers loaded into the project (two vector files "Amsterdam buildings" and "Amsterdam roads" and one raster file of OpenStreetMap). However, because OpenStreetMap is above the "Amsterdam buildings" layer in the layer list, the buildings layer is not visible on the map canvas. By reordering the layers so that OpenStreetMap is now at the bottom of the list, the buildings layer becomes visible on the map.


Initial layer ordering - buildings are not visible on map canvas
Reordered layers - buildings are now visible on map canvas

Useful links

Personal tools
Actions
Navigation
Tools