OSM data in QGIS for simple print maps
I’ve been wanting to make some print maps in QGIS using OSM data for roads. There’s a bunch of ways to do this from simple to complex, but I think I found a way that works for me.
- Start with an OSM extract in .osm.pbf format. These are produced daily for countries and regions and are manageable size.
- Import it as a layer into QGIS, which has native support for .osm.pbf format. However it will be slow because it is not indexed.
- Convert to GeoPackage in QGIS, with the defaults. All the property names, etc will be carried over and you’ll get a spatial index.
- Use the new GeoPackage layer in your maps, you can delete the old OSM PBF layer entirely.
The main drawback is you’re dealing with OSM schema. Ie, drawing roads involves deciphering all the possible tag values for “highway”. It’d be nice to use some processed dataset converted to a simpler schema but I don’t know of an easy way to get a free one.
If you don’t care about licensing, MapTiler has some very nice OSM Planet tiles you can easily import in new versions of QGIS using their MapTiler QGIS Plugin. You can import these as raster maps or vectors. The vectors come with some schema translation and styling so you start with an OSM-looking map right there in QGIS and then modify it as you wish. The downside is I’m not sure you can use this data for, say, a print project without a licensing agreement from MapTiler. Also I didn’t see any easy way to control the level of detail so if you want to override their idea of feature selection at a zoom level you may be out of luck.