Hi, I want to extract a route with the Overpass API which works great. But I have some problemns getting the order of the nodes inside the relation right. Check this relation: http://overpass-turbo.eu/s/hao It looks good on the map. But when you look at the data tab and you scroll a little down you see the coordinates jump from
which is in the middle of the route. At the bottom there are the parts which are in between. (14.xxx) So when I extract the route, process all the coordinates in the order the api returns them and convert it to a Google Polyline path, the route is messed up. Paste this path into Google maps example (https://developers.google.com/maps/documentation/utilities/polylineutility and click decode polyline)
How do I get overpass to give the nodes inside the relation in the correct order?? asked 06 Jul '16, 16:00 NLAnaconda |
Your conversion routine does not seem to work correctly. Ways in relations don't need to follow the exact sequence of a route. As Overpass API delivers the data in the exact same sequence as they are in the main OSM database, it's your responsibility to bring them in the right sequence in a post-processing step. As additional hint, please see this answer by scai: link Furthermore, you might want to check the result of answered 06 Jul '16, 17:01 mmd 1
Thanks, Got it working: http://bl.ocks.org/d/982ee618ffc16fbc82f463026ebcb7b5
(07 Jul '16, 02:09)
NLAnaconda
|