Reading .osm.pbf or converting .osm.pbf to .osm
Asked Answered
L

2

10

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

Larisalarissa answered 17/2, 2021 at 9:32 Comment(1)
You can try wiki.openstreetmap.org/wiki/Osmconvert, i.e. osmconvert myfile.osm.pbf > myfile.osm.Butt
D
16

I would use Osmosis for that:

osmosis --read-pbf myFile.osm.pbf --write-xml myFile.osm
Dame answered 17/2, 2021 at 17:34 Comment(2)
Additional tip - when working with larger maps always run it through OSM filter (wiki.openstreetmap.org/wiki/Osmfilter) before processing with OpenStreetMapXSolomon
The wiki says osmosis won't continue development, one should look into new tools especially when first learning them.Unvoice
E
4

I would use osmium to do this:

osmium cat myFile.osm.pbf -o myFile.osm
Enterotomy answered 5/12, 2022 at 13:9 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.