Here's what I did
from pyrosm import OSM
# Initialize the OSM parser object
osm = OSM('/DATA/user/nabih/indonesia-latest.osm.pbf')
# Read all drivable roads
drive_net = osm.get_network(network_type="driving")
But it is memory error
https://osmcode.org/pyosmium/ provides a library to parse a osm.pbf. From what I remember, they keep the memory consumption to the minimum and provide different modes of parsing.
Checkout their documentation
for basic usage tutorial and references.
The README of their GitHub
provides installation instructions.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With