NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

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's gravatar image

jkan997
11112
accept rate: 0%

edited 26 Aug '18, 21:16

aseerel4c26's gravatar image

aseerel4c26 ♦
32.6k18248554

1

Is using osmium a requirement or would some other tool also be fine for you?

(26 Aug '18, 15:18) aseerel4c26 ♦

Any free tool that will handle planet XML is fine.

(26 Aug '18, 20:25) jkan997

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.

(26 Aug '18, 21:18) aseerel4c26 ♦

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

(27 Aug '18, 00:30) kocio

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×315
×68

question asked: 26 Aug '18, 13:47

question was seen: 3,084 times

last updated: 27 Aug '18, 00:30

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum