Hi, I'm pretty new a OSM & the Overpass API. I was looking for, how to retrieve a list a stations of a given relation. Here is what came up with :
It works great but the station nodes are sorted by IDs in the XML. I was looking to get them sorted by the orientation (first station as first element, last station as last element). Do you know how can I can achieve this ? asked 02 Feb '14, 16:49 Kyro |
One Answer:
Unfortunately, this is currently not possible with the Overpass API alone. What you can do is print the relation also and then sort the stations in a post-processing step. answered 02 Feb '14, 17:11 tyr_asd |
Ok thanks, I went with a bash script to do this :
for i in
curl 'http://api.openstreetmap.org/api/0.6/relation/2418275' | grep stop | awk '{print $3}' | cut -d '"' -f2
; do curl
http://api.openstreetmap.org/api/0.6/node/${i}
; done`