SCENARIO: i have a segment (of a motorway, for example). is it possible to get all other segments of said motorway using OSM? asked 13 Nov '13, 18:38 tonygil |
It is technically possible from the OSM API (making recursive use of the /node/123/ways call to find out which other ways use the first/last node of the given way), but if done frequently it would be considered an abuse of the API. Often, the motorway will be part of a relation, and then it would be possible to use the /relation/123/full call to download the full relation. This, too, is something that we don't like to see in an automated fashion. If you want to make such queries regularly, set up your own database and import OSM data into it. Alternatively, check out if Overpasss API offers something that you can use. answered 13 Nov '13, 21:28 Frederik Ramm ♦ 2
An algorithm that adds all connected ways is likely to grab the entire street grid (at least of an island, maybe also Eurasia or America). A similar thing happens when one restricts to motorway and motorway_link with the motorway network. Thus I would strongly discourage this approach.
(14 Nov '13, 07:10)
Roland Olbricht
yes, i understand that, to do so, i would have to be using my own copy of OSM database, so as not to abuse the API. what approach would you suggest?
(14 Nov '13, 09:39)
tonygil
|
Please be more specific about what should be in the result:
Should the reverse direction of a dual carriageway be included?
Should everything with the same road number be included or the entire motorway grid? What about motorways that are split in multiple non-connected parts?
What parts of exit lanes, intersections and so on should be included?
thanx roland, wow, you got me there. in an ideal situation, everything that is related as part of the SAME motorway (numbering or name).