mocnik-science / osm-python-tools

A library to access OpenStreetMap related services
GNU General Public License v3.0
440 stars 48 forks source link

Exception: [OSMPythonTools.overpassQueryBuilder] Please provide an area or a bounding box #50

Closed sunyong2016 closed 2 years ago

sunyong2016 commented 2 years ago

query = overpassQueryBuilder(area=areaId, elementType='node', selector='"natural"="tree"', out='count')

====== Example 3 ====== File "D:\ProgramData\Anaconda3\envs\geoai\lib\site-packages\OSMPythonTools__init__.py", line 13, in _raiseException raise(Exception(msgComplete)) Exception: [OSMPythonTools.overpassQueryBuilder] Please provide an area or a bounding box

mocnik-science commented 2 years ago

Thanks @sunyong2016!

The issue arose because Nominatim returns another answer now. I turned out that the first item of the Nominatim result is a node, which has no areaId. I have fixed the bug by returning the first areaId that does not vanish. Please check that you download v0.3.4 of OSMPythonTools.