I need to export entire world railway network from planet file. I want to store them in PosGis database as collection of points and lines. I would like to simplify she shapes and remove parallel lines (in case of multiple tracks) In case of stations I need always to have point (even if in original it is shape). I made some experiments with osmium but without success - I don't know how to merge all tags relations and ways into lines. Any advice asked 26 Aug '18, 13:47 jkan997 aseerel4c26 ♦ |
Is using osmium a requirement or would some other tool also be fine for you?
Any free tool that will handle planet XML is fine.
okay, I have made your question's tags less specific to osmium. Since only the railway network is quite sparse data, I guess that going via Overpass API (instead of the full planet) might be a better option. But I neither know osmium nor the Overpass query languages good enough to help any further.
Osmium is quite straightforward. You might just pick every tag you need, for example water-related I needed:
osmium tags-filter -o planet-water.osm.pbf planet-latest.osm.pbf natural=water landuse=reservoir landuse=basin waterway=dock
It can also do much more complex things, see the documentation:
https://osmcode.org/osmium-tool/manual.html