7

I want to extract some information from a .osm.pbf file. I looked through OpenStreetMapX.jl package but didn't find a function to read this data. I am wondering if anyone know a method to read this data. Alternatively is there a way to convert .osm.pbf to .osm file so that I found just use the get_map_data() method offered by OpenStreetMapX package

imantha
  • 2,676
  • 4
  • 23
  • 46

2 Answers2

11

I would use Osmosis for that:

osmosis --read-pbf myFile.osm.pbf --write-xml myFile.osm
matthieun
  • 763
  • 5
  • 13
  • Additional tip - when working with larger maps always run it through OSM filter (https://wiki.openstreetmap.org/wiki/Osmfilter) before processing with OpenStreetMapX – Przemyslaw Szufel Feb 17 '21 at 22:34
  • The wiki says osmosis won't continue development, one should look into new tools especially when first learning them. – xeruf Dec 09 '21 at 10:30
3

I would use osmium to do this:

osmium cat myFile.osm.pbf -o myFile.osm
Zerta
  • 85
  • 6