Hi OSM community, I am new here and would be grateful if you could help me with the following. Background I am developing an android app that uses OSM maps. (Using Nutiteq SDK) Question I would like to know how to query for the bus services (relations) associated with a way id. Suggestions
Thank you for reading. Regards, David asked 20 May '14, 10:51 davidleejy |
ad 1. The website obviously has access to the main database. For external apps that are not editors, we prefer (strongly) that you use the overpass-api. You can use Overpass turbo to test your queries. These are all the bus routes using way 157561015. If later your app becomes wildly successful, we actually prefer you setup your own database. ;) ad 2. I think you answered your own question: spatialite osm raw answered 20 May '14, 13:03 cartinus Thank you cartinus. A "relation" node in the response has "member role" elements like so: ¶ ¶ <relation id="1147131"> <member role="" ref="174286674" type="way"/> <member role="" ref="175840093" type="way"/> ■ ■ ■ <member role="stop" ref="410484491" type="node"/> <tag v="WOODLANDS REG INT" k="from"/> <tag v="Svc 961" k="name"/> <tag v="SMRT" k="network"/> <tag v="961" k="ref"/> <tag v="bus" k="route"/> <tag v="LORONG 1 GEYLANG TER" k="to"/> <tag v="route" k="type"/> </relation> ¶ ¶ ¶ Might you also know how to shorten the response by leaving out "member role" elements?
(23 May '14, 14:09)
davidleejy
There is now a new feature in Overpass that gives you the relations without the members. In stead of:
write:
The only change is the last word.
(16 Jun '14, 20:00)
cartinus
|