Previously I explained to you how to make the speed limit in QGIS and display it in Google Maps. This process required drawing the new layer with including the speed limit of the given road sections collected from the Waze.com map service. Admittedly this is not the quickest way of getting a map such as this, although it gives you full control on the streets in your considered area. In practice, it means, that if at some point the road hasn’t been marked on the map yet, which is typical for quickly developing urban areas, it can be added (drawn) by yourself. On the other hand, the method can be useful in the case of omission the large dataset, which could make your computer frozen or simply in the situation when you don’t need to cover so much large area.
Now it’s time for the presentation of slightly another approach to preparing the speed limit map and not necessarily in QGIS only, although the method will be still based on this open-source GIS software. The primary thing here is, that the map can be done even within…5 minutes? Maybe let’s not exaggerate and give yourself about twice more, however, everything will depend on your expectations. Let’s plunge into it!
For clarity, the OpenStreetMap dataset will be used here, which can be imported from this map server in different ways. The OpenStreetMap offers large raw GIS data for any location you need. The dataset is maintained by several hundred thousand contributors around the world.
With reference to these several ways of extracting the OpenStreetMap data mentioned above, I would like to just skip across them, because only one approach is considered in the frame of this text. Without further ado, when you are interested in just a small area independent from any administrative borders, you can choose the Export from the OpenStreetMap panel. For larger areas, we can use the BBike extract platform, but if you need them bounded within some administrative boundaries, then the Geofabrik.de service will be the best. This is our task for now, however, it’s worth knowing that there is also a larger OpenStreetMap dataset than offered by Geofabrik.de. It’s the Planet OpenStreetMap service, about which I will write you in the future. Another option can be utilizing the OSM plugin for QGIS, Osmosis, and Multi-stream OSM data downloader. This is still not everything, which could let us get the stuff from OpenStreetMap because we can do it with the SUMO network file or OSM Extract.
The key thing is based on the maxspeed tag, used for roads and waterways in OpenStreetMap, which defines the maximum speed of the given road. We can add into the query result
The Geofabrik.de is the download server for the OpenStreetMap datasets, which is supposed to encourage societies to share their innovations and potential ideas. Moreover, this data is mostly free of most kinds of license restrictions. In practice, the dataset available in this service can be distributed in any way and through any channel.
I. STEPS TO MAKING THE SPEED LIMIT MAP QUICKLY
1. The very first step is visiting the Geofabrik.de service. The administrative selection looks like presented below (Pic. 1).
When you select the proper region, the most convenient option is downloading it as a zipped shapefile.
2. Select the appropriate shapefile and load it to QGIS. In our case, we just need the road network (Pic. 2).
Alternatively, we can grab the highlighted file from the extracted folder, drag it onto QGIS map canvas and drop it there. It will give the same effect on us.
3. Since our road network layer has been loaded successfully (Pic. 3). As the first thing, we should open the data attribute table.
In the data attribute table, we should sanitize the road network by the maxspeed column, which will give us just these roads, where the maximum speed limit has been set. In this case, we should use the “Select by expression” option and use the following formula:
maxspeed > 0
maxspeed is NOT null
considering the situation, where instead of the value 0, we have a blank cell in the maxspeed column.
Another, but not an essential step can be showing only selected items in our data attribute table unless your QGIS doesn’t respond for a long time (Pic. 4).
You should now see the roads with the speed limit selected. Other stuff is out of classification, which applies for i.e. cycle routes, footways, and other networks like this (Pic. 5).
4. However the most important thing here is extracting all the selected stuff from the whole layer. We can do it by exporting them in a separate file (Pic. 5).
After loading the exported road network to our QGIS project again, we will see basically everything needed for our next step. The previous layer containing the whole lot can be turned off (Pic. 6).
5. Our next step will be categorizing the road network by the speed limit value defined. We might have quite a lot of categories, however, it shouldn’t be a problem to allocate an appropriate coloration and line thickness (Pic. 8). We should remember a couple basic things here like the selection of the proper column and auto-categorization of the values (Pic. 7).
6. We are essentially done! Our map looks like below (Pic. 9).
However, we have some incomplete parts of the Greater London area, as you can see below. It looks like in one places the maxspeed value hasn’t been filled up. On top of that in other areas probably wrong values have been provided (Pic. 10).
7. At the very end we can customize our map by adding decoration elements (Pic. 11) or editing the print layout items (Pic. 12).
Downloading data from the Geofabrik server is very convenient. We can have the whole voivodeship or even country in one go, as long as your computer memory resists it. However as the OpenStreetMap dataset is an output of a multitude of contributors worldwide, we must be aware, that the data might be patchy in some regions. As a result, we can get simply incomplete data for our work (Pic. 10). An alternative way is editing the OpenStreetMap speed limits, which can be done i.e. by the StreetComplete editor or some mundane methods like checking the Mappillary imagery, where the speed limit signs can be discerned from the user images, Google Street View, or Waze.com discussed earlier working pretty much at similar basis as the OpenStreetBrowser.
In other cases, the maxspeed value alterations are required, especially when the on-site situation has changed (i.e. residential area has been expanded). If they are not provided yet or the input is wrong, they do give not genuine information for us, which is adequate to lack of the information.
Another problem might be the server limitation, which makes you unable to download for example a whole continent in smaller pieces. In this case, better is to save the dataset in one go.
- Ramm F., 2021, OpenStreetMap Data in layered GIS format – version 0.7.11
- Zilske M., Neuman A., Nagel K, 2011, OpenStreetMap for traffic simulation, (in:) OpenStreetMap conference, Wien, p.126-134.
- How can I get route data into a SHP or KMZ file for GIS software like QGis?
- Is There a Website That Shows The Different Speed Limits in Victoria?
- Github.com: Quick editing of OpenStreetMap speed limits