Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question about the loading of osm data #8

Open
gujiaqivadin opened this issue Jul 10, 2023 · 2 comments
Open

Question about the loading of osm data #8

gujiaqivadin opened this issue Jul 10, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@gujiaqivadin
Copy link

Hello, thx for your great work of orienternet. I have a question about the loading of osm data. I found that in reader.py, it supports loading OSMData from "from_dict", "from_json" and "from_xml". But the main format of osm.data is "xx.osm.pbf". I wonder the utils functions of openstreetmap is written by yourself or from other resources. Or can you provide a "from_pbf" function in the code.

Thank you very much!

@sarlinpe
Copy link
Collaborator

sarlinpe commented Jul 10, 2023

Geofabrik also serves compressed XML files as .osm.bz2, which you just need to extract. Alternatively, you can convert a binary file .osm.pbf to an XML file .osm using the osmium tool. I will check whether this can be done in the code using pyosmium or so - feel free to send a PR if you get it working.

@sarlinpe sarlinpe added the enhancement New feature or request label Jul 10, 2023
@gujiaqivadin
Copy link
Author

Hello, I finish the convertion by the following steps:
conda install -c conda-forge osmium-tool
and
osmium cat xx.osm.pbf -o xx.osm

The osmium tool is very convenient!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants