Re:OpenStreetMap Is in Trouble
by maxerickson on Friday February 16, 2018 @05:01PM
(#16396871)
In some sense there is a layer, features related to railways will all have a railway tag (or be listed as a member of one of those features). There's some description here:
In the sense of being easy to retrieve I guess it isn't a layer. Global railway data will be pretty huge, so Overpass-API may not work out if that is what you want. In that case, the strategy is to grab a planet file (a snapshot of the db) and filter it locally:
And then you probably have to translate the resulting data into a format that you would use for your map.
As to why you have to do that work instead of just pulling layers, it comes down to the core data model being focused on editing and there being many different end use cases (making it difficult to anticipate and serve each one).
https://wiki.openstreetmap.org/wiki/Railways
In the sense of being easy to retrieve I guess it isn't a layer. Global railway data will be pretty huge, so Overpass-API may not work out if that is what you want. In that case, the strategy is to grab a planet file (a snapshot of the db) and filter it locally:
http://osmcode.org/osmium-tool/manual.html#filtering-by-tags
And then you probably have to translate the resulting data into a format that you would use for your map.
As to why you have to do that work instead of just pulling layers, it comes down to the core data model being focused on editing and there being many different end use cases (making it difficult to anticipate and serve each one).