Closed csmotion closed 2 years ago
Noticed this in the error. The semi-colon between [out:json] and [bbox causes an invalid request in overpass turbo. Removing it results nets a valid request:
WARNING:OSMPythonTools:[overpass] downloading data: [timeout:60][out:json];[bbox:40.115150, -105.143300, 40.215150, -105.043300]; way[highway]->.major; way[highway]->.minor; node(w.major)(w.minor); out body geom; ERROR:OSMPythonTools:The requested data could not be downloaded. HTTP Error 400: Bad Request
I'm still not sure how to place bbox in the manually formed query in a way that yields a valid request.
Ok, this is my bad. Looks like solution is to stuff into the settings arg of query call like so:
# Construct intersection query
query = 'way[highway]->.major; way[highway]->.minor; node(w.major)(w.minor); out body geom;'
strBbox = "%3.6f, %3.6f, %3.6f, %3.6f" % (bbox[0], bbox[1], bbox[2], bbox[3])
bbox = {'bbox': strBbox}
logger.info(query)
# Query
self.intersections = self.overpass.query(query, timeout=60, settings=bbox)
logger.info(self.intersections.countNodes())
First, let me say that OSMPythonTools is really excellent, the work is much appreciated!
I'm looking for major/minor road intersections per this example: https://gis.stackexchange.com/questions/296278/overpass-api-find-road-intersection-points-with-defined-line
I manually construct my query as follows:
My constructed query is as follows, and successfully runs in overpass turbo, but I get HTTP Error 400: Bad Request when running overpass.query.
Thoughts?