pyrosm
pyrosm copied to clipboard
Writing OSM PBF files?
Hi @HTenkanen -- I was just looking at #227 and wondered more broadly: has there ever been any discussion among the pyrosm contributors regarding making the package able to both read and write pbf files? I understand at this point that it is a tool only for reading. But there seems to be a total lack of tools to write OSM pbf files in the Python world. This would certainly be valuable as many users have a workflow like 1) load OSM data, 2) edit the data, 3) save the data as xml or pbf for subsequent use in other tools.
The reason I ask this... if there is interest in pyrosm writing pbf files, I could see opportunities for beneficial coupling with OSMnx. Currently, OSMnx can build graphs and feature GeoDataFrames from XML data and it can write graphs (slow and hacky) to XML. But this is in many ways a minimal afterthought for the OSMnx project, which is really designed around working with Overpass/Nominatim web APIs. As we approach the OSMnx 2.0 release later this year, I've been questioning whether OSMnx is even the right home for that read/write XML code, or if we can just add an optional dependency and hand off OSM file read/write to it (XML vs PBF format doesn't matter since tools like osmium can easily convert between them). pyrosm would be a natural fit for such an optional dependency of OSMnx if it could also write a graph/gdf to a pbf file.
Feel free to just close this if it's outside of your project's scope.