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.
Tout le monde peut utiliser ce jeu de données sans aucune difficulté mais vous préférerez sans doute utiliser les données de votre propre pays ou votre propre ville. Si vous choisissez cette voie, vos données propres seront utilisées dans toutes les leçons du module 3 au module 7.2. D’autres modules utilisent des sources de données plus complexes qui ne seront peut-être pas disponibles pour votre région.
Note
Ce processus est prévu pour les formateurs ou les utilisateurs plus expérimentés de QGIS qui souhaitent créer des jeux de données locaux pour leur formation. Les jeux de données par défaut sont fournis avec le manuel d’exercice mais vous pouvez suivre les instructions qui suivent si vous désirez les remplacer.
Note
The sample data used throughout the manual can be downloaded here: https://github.com/qgis/QGIS-Training-Data/archive/QGIS-Training-Data-v1.0.zip. You can save the files in a folder named exercise_data.
Note
Ces instructions supposent que vous avez une bonne connaissance de QGIS et n’ont pas vocation à être utilisées comme ressource pédagogique.
Si vous voulez remplacer le jeu de données par défaut avec le votre pour la formation, vous pouvez le faire facilement avec les outils inclus dans QGIS. La région que vous choisissez devrait avoir un mélange correct entre les zones urbaines et rurales, contenir des routes de différentes classes, des limites administratives (comme les réserves naturelles ou les fermes) et des surfaces en eau telles que les ruisseaux et les rivières.
Ouvrez un nouveau projet QGIS
other_relations
and multilinestrings
layer:This will load three layers into your map which relate to OSM’s naming
conventions (you may need to Zoom Full to see the
vector data).
We need to extract the useful data from these layers, rename them and create corresponding shape files:
multipolygons
layer to open the
Layer properties dialog.This layer contains three fields whose data we will need to extract for use throughout the Training Manual:
building
natural
(specifically, water)landuse
You can sample the data your region contains in order to see what kind of results your region will yield. If you find that “landuse” returns no results, then feel free to exclude it.
You’ll need to write filter expressions for each field to extract the data we need. We’ll use the “building” field as an example here:
building != "NULL"
and click Test to see how many results
the query will return. If the number of results is small, you may wish to
have a look at the layer’s Attribute Table to see what data OSM
has returned for your region:We now need to save the resulting data as a shapefile for you to use during your course:
ESRI Shapefile
and save the file in your
new exercise_data
directory, under a directory called “epsg4326”.Once the buildings layer has been added to the map, you can repeat
the process for the natural
and landuse
fields using the following
expressions:
Note
Make sure you clear the previous filter (via the Layer properties dialog) from the multipolygons layer before proceeding with the next filter expression!
natural
: “natural = ‘water’”landuse
: “landuse != ‘NULL’”Each resulting data set should be saved in the “epsg4326” directory in your new
exercise_data
directory (i.e. “water”, “landuse”).
You should then extract and save the following fields from the lines
and
points
layers to their corresponding directories:
lines
:
“highway != ‘NULL’” to roads
, and
“waterway != ‘NULL’” to rivers
points
:
“place != ‘NULL’” to places
Once you have finished extracting the above data, you can remove the multipolygons, lines and points layers.
You should now have a map which looks something like this (the symbology will certainly be very different, but that is fine):
The important thing is that you have 6 layers matching those shown above and that all those layers have some data.
The last step is to create a spatiallite file from the landuse
layer for
use during the course:
landuse
layer and select Save as...landuse
under the “epsg4326” directory.landuse.shp
and its related files (if created).For Module 6 (Creating Vector Data) and Module 8 (Rasters), you’ll also need raster images (SRTM DEM) which cover the region you have selected for your course.
Le CGIAR-CGI (http://srtm.csi.cgiar.org/) fournit des MNE SRTM que vous pouvez télécharger depuis http://srtm.csi.cgiar.org/SELECTION/inputCoord.asp.
You’ll need images which cover the entire region you have chosen to use.
If you kept same data as the training manual, you can use the extent shown
in the figure_set_osm_region figure above, otherwise adapt your extent.
Keep the GeoTiff
format. Once the form is filled, click on the
Click here to Begin Search >> button and download the file(s).
Une fois que vous avez téléchargé le/les fichier(s) requis, vous devriez les sauvegarder dans le répertoire exercise_data
sous raster/SRTM
.
In Module 6, Lesson 1.2 shows close-up images of three school sports fields which students are asked to digitize. You’ll therefore need to reproduce these images using your new SRTM DEM tiff file(s). There is no obligation to use school sports fields: any three school land-use types can be used (e.g. different school buildings, playgrounds or car parks).
For reference, the images in the example data are:
Having created your localised dataset, the final step is to replace the tokens
in the conf.py
file so that the appropriate names will appear in your
localised version of the Training Manual.
Les variables qui doivent être remplacées sont les suivantes:
majorUrbanName
: this defaults to “Swellendam”. Replace with the name of
the major town in your region.schoolAreaType1
: this defaults to “athletics field”. Replace with the
name of the largest school area type in your region.largeLandUseArea
: this defaults to “Bontebok National Park”. Replace
with the name of a large landuse polygon in your region.srtmFileName
: this defaults to srtm_41_19.tif
. Replace this with
the filename of your SRTM DEM file.localCRS
: this defaults to WGS 84 / UTM 34S
. You should replace
this with the correct CRS for your region.