7.3.3. Importing vector and raster data
Now it is time to add some data to the new empty QGIS project:
- Choose Layers.
- Select Add Vector Layer.
- Browse to the source folder of your Geodata (for example select commune_boundary_FR.shp, see section 5.3.).
- Press Open to load the
As an intermediate result, a rectangle full of polygons (see section 2.2.1.) representing different administrative districts, called communes, within the canton of Fribourg (western Switzerland) appears (Fig. 73).
In the same way, but with the Add Raster Layer function, a DEM (see section 3.2.4.) can be added to the map:
- Open Layers.
- Select Add Raster Layer.
- Browse to the source folder of your Geodata (for example select ASTER30_WGS84.tif).
- Click Open to load the DEM
A rectangular greyscale raster image appears around the city of Fribourg in western Switzerland (Fig. 73). If the raster is not visible, please check that the “on-the-fly” CRS transformation is enabled within the dialog accessible through the menu Settings > Project Properties > Coordinate Reference Systems (CRS) (see also Fig. 72).
If the raster image is displayed in a uniform grey, the display options must be adapted:
- Open Layer.
- Click Properties.
- Select the Style tab.
- Click Load in the Load min/max values from band option.
- In the Contrast enhancement option, choose Stretch to MinMax. The raster values range from 407 (black) to 883 (white), that represents the altitude above sea level in meters.
- Click OK.
The new data will be added to the top of the map, thus probably hiding some other content behind it (the display order is defined by the hierarchy in the Map Legend). Considering the current map display, we see that the raster image has a smaller extent than the vector layer and only few a details are visible at this scale. To zoom to the region of interest around Fribourg, suitable operations are:
- Using the Zoom and Pan icons in the Map Navigation toolbar or the same functions in the menu View
- Right-click on the raster image in the Map Legend (in our example called ASTER30_WGS84) and choose the option Zoom to layer extent.
- Zoom with the mouse wheel placing the cursor at the centre of the area
Now the topography and the Sarine
River crossing the city of Fribourg from south to
north are visible (Fig. 74). First of all, from this step we learn that QGIS
has several tools for similar applications, and every user will find and choose
the most efficient manner to achieve their goals. Second, it is beneficial to
use (or even try) the right mouse button, for example to set the Map View exactly to the extent of one
specific layer or to the access the Layer
Properties. Advanced users might be comfortable using the mouse wheel to
change the zoom level while other tools stay activated (e.g. during
Fig. 73. A polygon layer containing administrative
districts (municipalities) around the city of Fribourg (western Switzerland)
has been loaded to the QGIS project. Reproduced with permission of Swisstopo
Fig. 74. Result after adding the digital elevation model and zooming to its extent. Reproduced with permission of Swisstopo (BA13016).