Tutorial – How to import OSM data in QGIS and use a rule-based filter for values in "other_tags"
From Alexander Sanning
views
Related Media
Map data attribution:
OpenStreetMap – openstreetmap.org/copyright
.........................................
Timestamps:
0:00 [Intro] Scope of the tutorial
0:13 [QGIS] Fixing erroneously ordered layer, and adding a custom polygon layer to replace missing feature
1:22 [QGIS] Categorizing and classifying highways, to show roads
2:30 [QGIS] Categorizing and classifying railways
2:55 [QGIS] Styling the infrastructure layers
6:06 [QGIS] Importing the multiline OSM data, and categorizing and classifying the data based on name
7:17 [QGIS] Styling the municipal transportation line layer
8:03 [QGIS] Debugging erroneously coloured item (unfruitful, QGIS crashed instead)
8:37 [QGIS] Backtracking to resume to the point of the crash and saving (bug did not reappear)
9:05 [QGIS] Assigning specific hexadecimal values for the colours of the transportation lines
10:48 [QGIS] Timelapse of repeating the process for the rest of the transportation lines
11:21 [QGIS] Importing the point OSM data, and using a custom rule to filter out most of the unwanted data
12:42 [QGIS] Refining the rule-based filter to filter out the rest of the unwanted data
15:10 [QGIS] Styling the points layer for the municipal transport stations
16:45 [QGIS] Creating a separate rule for tram stops, and altering the styling
18:06 [QGIS] Exporting the map and evaluating the result
.........................................
Links:
Previous tutorial (which this one builds upon):
https://www.youtube.com/watch?v=AmbtTQY2Gsk
Learn OpenStreetMap:
https://learnosm.org/en/osm-data/osm-in-qgis/
Eye Dropper (extension for Google Chrome):
https://eyedropper.org/
OpenStreetMap:
https://www.openstreetmap.org/#map=13/59.3387/18.0732
OpenStreetMap attribution guidelines:
https://osmfoundation.org/wiki/Licence/Attribution_Guidelines
QGIS:
https://qgis.org/en/site/
.........................................
Rule-based expressions for adequate filtering of OSM tags residing in "other_tags":
Railway stations:
hstore_to_map(other_tags)['public_transport'] is 'station'
AND
hstore_to_map(other_tags)['ferry'] is NULL
AND
hstore_to_map(other_tags)['amenity'] is not 'bus_station'
AND
hstore_to_map(other_tags)['operator'] is not 'Arlanda Express'
Tram stops:
hstore_to_map(other_tags)['public_transport'] is 'stop_position'
AND
hstore_to_map(other_tags)['railway'] is 'tram_stop'
.........................................
Stroke widths (only as an example):
0.35
0.25
0.18
0.13
0.08
0.01
.........................................
This tutorial demonstrates to KTH Architecture students how to use the freely available OpenStreetMap GIS data in QGIS, and in this follow-up tutorial specifically, how to import multiline and point data for the municipal transportation system, and how to effectively filter the data by using a custom rule-based filter.
The operating system used for this tutorial is Windows 10. Running another operating system (e.g. Linux, MacOS) might amount to a different user experience or software incompatibility.
If you want to check in which computer room(s) any relevant software might be installed in – CADLAB, DFL, and ARCPLAN are in the KTH School of Architecture building – please check the following link for current status:
https://www.kth.se/en/student/it/campus/computer-rooms/lista
Disclaimer:
This tutorial aims to increase student awareness of the versatility of the digital tools available for use within the context of the architectural education offered by KTH. As such, it might not be generally applicable, but on the other hand, if at least one architecture student is helped by it in fulfilling deliverables requirements or being taught something of genuine interest, the purpose of this tutorial is satisfactorily achieved. There might be inaccuracies in this tutorial – if you identify any significant one, please tell us in the comments.
OpenStreetMap – openstreetmap.org/copyright
.........................................
Timestamps:
0:00 [Intro] Scope of the tutorial
0:13 [QGIS] Fixing erroneously ordered layer, and adding a custom polygon layer to replace missing feature
1:22 [QGIS] Categorizing and classifying highways, to show roads
2:30 [QGIS] Categorizing and classifying railways
2:55 [QGIS] Styling the infrastructure layers
6:06 [QGIS] Importing the multiline OSM data, and categorizing and classifying the data based on name
7:17 [QGIS] Styling the municipal transportation line layer
8:03 [QGIS] Debugging erroneously coloured item (unfruitful, QGIS crashed instead)
8:37 [QGIS] Backtracking to resume to the point of the crash and saving (bug did not reappear)
9:05 [QGIS] Assigning specific hexadecimal values for the colours of the transportation lines
10:48 [QGIS] Timelapse of repeating the process for the rest of the transportation lines
11:21 [QGIS] Importing the point OSM data, and using a custom rule to filter out most of the unwanted data
12:42 [QGIS] Refining the rule-based filter to filter out the rest of the unwanted data
15:10 [QGIS] Styling the points layer for the municipal transport stations
16:45 [QGIS] Creating a separate rule for tram stops, and altering the styling
18:06 [QGIS] Exporting the map and evaluating the result
.........................................
Links:
Previous tutorial (which this one builds upon):
https://www.youtube.com/watch?v=AmbtTQY2Gsk
Learn OpenStreetMap:
https://learnosm.org/en/osm-data/osm-in-qgis/
Eye Dropper (extension for Google Chrome):
https://eyedropper.org/
OpenStreetMap:
https://www.openstreetmap.org/#map=13/59.3387/18.0732
OpenStreetMap attribution guidelines:
https://osmfoundation.org/wiki/Licence/Attribution_Guidelines
QGIS:
https://qgis.org/en/site/
.........................................
Rule-based expressions for adequate filtering of OSM tags residing in "other_tags":
Railway stations:
hstore_to_map(other_tags)['public_transport'] is 'station'
AND
hstore_to_map(other_tags)['ferry'] is NULL
AND
hstore_to_map(other_tags)['amenity'] is not 'bus_station'
AND
hstore_to_map(other_tags)['operator'] is not 'Arlanda Express'
Tram stops:
hstore_to_map(other_tags)['public_transport'] is 'stop_position'
AND
hstore_to_map(other_tags)['railway'] is 'tram_stop'
.........................................
Stroke widths (only as an example):
0.35
0.25
0.18
0.13
0.08
0.01
.........................................
This tutorial demonstrates to KTH Architecture students how to use the freely available OpenStreetMap GIS data in QGIS, and in this follow-up tutorial specifically, how to import multiline and point data for the municipal transportation system, and how to effectively filter the data by using a custom rule-based filter.
The operating system used for this tutorial is Windows 10. Running another operating system (e.g. Linux, MacOS) might amount to a different user experience or software incompatibility.
If you want to check in which computer room(s) any relevant software might be installed in – CADLAB, DFL, and ARCPLAN are in the KTH School of Architecture building – please check the following link for current status:
https://www.kth.se/en/student/it/campus/computer-rooms/lista
Disclaimer:
This tutorial aims to increase student awareness of the versatility of the digital tools available for use within the context of the architectural education offered by KTH. As such, it might not be generally applicable, but on the other hand, if at least one architecture student is helped by it in fulfilling deliverables requirements or being taught something of genuine interest, the purpose of this tutorial is satisfactorily achieved. There might be inaccuracies in this tutorial – if you identify any significant one, please tell us in the comments.
- Tags
-