Preparing Exercise Data - QGIS Documentation Documentation
Preparing Exercise Data - QGIS Documentation Documentation
Previous Next
This process is intended for course conveners, or more experienced QGIS users who wish to create localised sample data sets for their course. Default data sets
are provided with the Training Manual, but you may follow these instructions if you wish to replace the default data sets.
The sample data provided with the Training Manual refers to the town of Swellendam and its surroundings. Swellendam is located about 2 hours’ east of Cape Town
in the Western Cape of South Africa. The dataset contains feature names in both English and Afrikaans.
Anyone can use this dataset without difficulty, but you may prefer to use data from your own country or home town. If you choose to do so, your localised data will
be used in all lessons from Module 3 to Module 7.2. Later modules use more complex data sources which may or may not be available for your region.
Note
These instructions assume you have a good knowledge of QGIS and are not intended to be used as teaching material.
If you wish to replace the default data set with localised data for your course, this can easily be done with tools built into QGIS. The region you choose to use should
have a good mix of urban and rural areas, containing roads of differing significance, area boundaries (such as nature reserves or farms) and surface water, such as
streams and rivers.
Now that we have the area we’ll extract the data from, let’s enable the extraction tools.
A new building layer is added to the Layers panel, showing buildings in the selected extent.
This process adds the layers as temporary files (indicated by the icon next to their name).
You can sample the data your region contains in order to see what kind of results your region will yield.
We now need to save the resulting data to use during your course. We’ll be using ESRI Shapefile, GeoPackage and SpatiaLite formats depending on the data.
1. Click the icon next to the place layer to open the Save Scratch Layer dialog.
Note
If you need to change any of the temporary layer’s properties (CRS, extent, fields…), use the Export ► Save Features as… contextual menu instead, and ensure
the Add saved file to map option is checked. This adds a new layer.
4. Press OK
In the Layers panel, the temporary place layer is replaced with the saved places shapefile layer and the temporary icon next to it removed.
5. Double-click the layer to open its Layer Properties ► Source tab and update the Layer name property to match the file name.
6. Repeat the process for other layers, renaming them as follows:
The next step is to create a GeoPackage file from the building layer to use during the course:
The last step is to save the remaining temporary file as a SpatiaLite file.
4. Press OK
You should now have a map which looks something like this (the symbology will certainly be very different, because QGIS randomly assigns colors when layers are
added to the map):
The important thing is that you have 7 vector layers matching those shown above and that all those layers have some data.
The CGIAR-CGI provides some SRTM DEM you can download from https://srtm.csi.cgiar.org/srtmdata/.
You’ll need images which cover the entire region you have chosen to use. To find the extent coordinates, in QGIS , zoom to the extent of the largest layer and pick
the values in the Extents box of the status bar. Keep the GeoTiff format. Once the form is filled, click on the Click here to Begin Search >> button and download
the file(s).
Once you have downloaded the required file(s), they should be saved in the exercise_data directory, under raster/SRTM subfolders.
Having created your localized dataset, the final step is to replace the tokens in the substitutions.txt file so that the appropriate names will appear in your localized
version of the Training Manual.