7.3.3. Importing vector and raster data

Now it is time to add some data to the new empty QGIS project:

  1. Choose Layers.
  2. Select Add Vector Layer.
  3. Browse to the source folder of your Geodata (for example select commune_boundary_FR.shp, see section 5.3.).
  4. Press Open to load the shapefile.

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:

  1. Open Layers.
  2. Select Add Raster Layer.
  3. Browse to the source folder of your Geodata (for example select ASTER30_WGS84.tif).
  4. Click Open to load the DEM into QGIS.
    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:
  5. Open Layer.
  6. Click Properties.
  7. Select the Style tab.
  8. Click Load in the Load min/max values from band option.
  9. 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.
  10. 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 text icon19
  • 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 of interest.

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 digitisation).

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 (BA13016).
figure073


Fig. 74.
Result after adding the digital elevation model and zooming to its extent. Reproduced with permission of Swisstopo (BA13016).

figure074

 

7.3.3.2. GPS and KML data, working with different coordinate systems

The BEEBOOK