Download OpenStreetMap data as Shapefiles
OpenStreetMap is the largest international project that aims to create a free world map. Voluntary "mappers" collect data about roads, railways, rivers, forests and houses and make them available online.
If you also want to get involved in the OpenStreetMap project, you can find further information here: https://www.openstreetmap.de/faq.html#wie_mitmachen.
The data is freely available to all people. You can also use OpenStreetMap data commercially because it was published under the Open Data Commons Open Database License
The data is offered by OSM as XML or PBF, which is a "compact" data format for the raw data from OpenStreetMap. The file Planet.osm contains the entire planet that has been recorded so far and the full history planet version even contains all version histories of all objects. This file is usually updated once a week.
With tools such as Osmosis or Osm2pgsql, this geodata can then be imported into a Postgis database. However, since this file is very large (76GB), most of you will probably not be able to start with it. Instead of using the file of the entire planet it is more useful to extract the part of it that you will need. You can do this on your own or use services such as Geofabrik offers them.
Fortunately, there are Geofabrik that process OSM files and partially also make them available free of charge.
At https://download.geofabrik.de/ you will find download links for specific regions, where you can finally download OpenStreetMap data as shapefiles. There is also a small map at the top right of the website that shows the area of the selected data.
The data can also be downloaded as .pbf or bz2 files.
With a click on a region you land in the "sub-region", in which data of individual countries can then be downloaded. In Europe, shapefiles of the OSM data can be downloaded for almost all countries.
For Germany there is unfortunately only the possibility to download shapefiles of the individual federal states.
In addition, polygons of the dimensions of the individual federal states can be downloaded.
There is of course a unique ID for each object. When looking at street objects, there are so-called "other_tags" in addition to the name and type of street (residential, tertiary, secondary, unclassified, etc.).
There you will find all additional attributes that describe the object in more detail. In the case of the street, the maximum permitted speed, the maximum allowed weight, the zip code of the municipality, the material of the street and even more properties are described.
With special queries you can access these "other_tags" and, for example, only show all paved roads in QGIS.
With the usual "OSM Basemap" all these objects are rendered and displayed in the usual OpenStreetMap design.
Updated 12 October 2021 at 21:13 GMT+2
About The Author
Hi, I'm Max (he/him). I am a geospatial developer, author and cyclist from Rosenheim, Germany.
Have you published a response to this? Send me a webmention by letting me know the URL.
Found no Webmentions yet. Be the first!
- In this article i want to show you how you can build your own Mapnik stylesheet for displaying any data from PostgreSQL/PostGIS. The Mapnik Stylesheet XML can be used for a tile-server with your custom style.
- Inspired by Aaron Parecki and who he has been tracking his location since 2008 with an iPhone app and a server side tracking API i decided to go for a similar approach. I wanted to track my position constantly with my Android smartphone and use the data to display a map with all locations i have ever been to.
- Step-by-step guide explaining how to fetch data from Garmin Connect, store it in Strapi and visualize it with NextJS and React-Leaflet.