I want to retrieve all the bus routes (as a collection of lines) from openstreetmap for a given city.
I'm currently using the
overpy module (v0.4) to access the Overpass API and this query:
QUERY = """ [out:json]; area[name="%(city)s"]->.a; ( node["route"="%(type)s"](area.a); way["route"="%(type)s"](area.a); relation["route"="%(type)s"](area.a); ); out body; >; out skel; """
city is the city i'm interested in, and
type could either be
The problem is, this does not work often :( If I'm looking for the bus routes for a very well known city like Chicago it returns an empty set, while other times the result set is partial (like for Philadelphia for example); very rarely it is able to correctly select the city and grab all the routes.
If I use the same query (without the
area selector) in http://overpass-turbo.eu/ when focused on Chicago it is able to return the routes as expected; so I suspect there's something wrong with the way I'm using
Do you have any idea how can I achieve this?