mvexel / overpass-api-python-wrapper

Python bindings for the OpenStreetMap Overpass API
Apache License 2.0
360 stars 89 forks source link

Known maximum length of number of ways/nodes to request in single query #66

Closed eoglethorpe closed 6 years ago

eoglethorpe commented 7 years ago

Seems that overpass will only accept a maximum of 1023 elements per query.

For instance this works fine:

import overpass
api = overpass.API()

#t looks something like (node(-1); node(-1)...;)
t = ('(' + ';'.join(['way(-1)' for v in xrange(0,1023)]) + ';)')
api.Get(t)`

But this gives an OverpassSyntaxError:

t = ('(' + ';'.join(['way(-1)' for v in xrange(0,1024)]) + ';)')
api.Get(t)`

I can't seem to find anything documentation on the maximum number of elements you can query at once. It would be nice to have a more detailed error if this is an exception that can be specifically handled

mmd-osm commented 7 years ago

That's a bug in Overpass API, actually.

mmd-osm commented 7 years ago

That bug has been fixed in the meantime, but somehow Roland forgot to include this patch in the overpass-api.de deployment. @drolbr

mvexel commented 6 years ago

@mmd-osm I am guessing this should no longer be an issue?

mmd-osm commented 6 years ago

Right, this issue can be closed, it has been fixed upstream.