This is a static archive of our old OpenStreetMap Help Site. Please post any new questions and answers at community.osm.org.

Plot OpenStreet Map pbf/xml file

0

I have downloaded the pbf file of OpenStreet Map historical data from this site https://planet.openstreetmap.org/planet/full-history . How can I plot the graph using python?

asked 12 Apr '20, 08:49

Satabdi's gravatar image

Satabdi
21114
accept rate: 0%

edited 12 Apr '20, 08:52


One Answer:

1

For maps, we don't use the term "plot a graph" - we speak of "rendering a map". While plotting a graph usually involves nothing more than saying "here's a bunch of numbers, please draw this" (and perhaps adding "... with a blue line"), rendering a map is vastly more complicated, as you will need drawing styles for every single feature, and potentially on different zoom levels.

To make matters even more complicated, the history file not only contains different map features, but timestamps as well. You cannot (easily) render a map that shows different times; you will first have to decide which date you want to draw a map for, so you'll want to use the osmium command line tool to extract the data for a specific date. Then you can proceed with rendering it; if you want to render the map for the whole planet you might need to load the data into a PostgreSQL data base with osm2pgsql then render with a tile server (Mapnik, renderd), or if you only want a small area then you can again use osmium to excerpt that area from the history file and render it with something like Maperitive or even QGIS.

You will need to tell us more about what you want to do in order for us to help you better!

answered 12 Apr '20, 11:08

Frederik%20Ramm's gravatar image

Frederik Ramm ♦
82.5k927201273
accept rate: 23%

I want to work with a particular country/small place Like Bangladesh. How can I do that? Do you have any tutorial link? so that I can get some help from there

(12 Apr '20, 11:17) Satabdi
1

Are you looking to make a web map, a printed map, or what? And do you want current data or old (historic) data?

(12 Apr '20, 17:06) Frederik Ramm ♦

I want to work with the data from 2014-2020. I want to work with the changes in the road network of a place in Python environment.

(13 Apr '20, 06:35) Satabdi

Source code available on GitHub .