I'd like to collect forest data on overpass turbo. But my code isn't working properly. Here is the first version:

import overpass

api = overpass.API()

res = api.get("""
 out body;

Here's the error message:

Traceback (most recent call last):
  File "D:/3_PROJETS/00_TD/TD7-analyse_spatiale/02_TRAVAIL/forest.py", line 16, in <module>
  File "C:\python35\lib\site-packages\overpass\api.py", line 130, in get
    return self._as_geojson(response["elements"])
  File "C:\python35\lib\site-packages\overpass\api.py", line 214, in _as_geojson
    raise UnknownOverpassError("Received corrupt data from Overpass (incomplete polygon).")
overpass.errors.UnknownOverpassError: Received corrupt data from Overpass (incomplete polygon).

I've tried many different syntaxes but none of them have worked so far.


Your query has a syntax error, namely an extra semicolon in the following line, which needs to be removed.


Before trying any queries in Python, better test them in overpass turbo first, until they work correctly.

  • I have the same error message for this request: rel["name"="Noues de Sienne"](46.081,-5.438,50.121,0.439); which does work in overpass turbo. Any idea ? May 8 '20 at 15:56
  • Looking at the current code there is a check that I just do not need. I will work on that. May 8 '20 at 16:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.