mocnik-science / osm-python-tools

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

Overpass shallow query results in an error #68

Open RaczeQ opened 2 years ago

RaczeQ commented 2 years ago

Having shallow parameter on True for overpass results in passing just a boolean as dict to _rawToResult function and ends up with

File .../.venv/lib/python3.8/site-packages/OSMPythonTools/overpass.py:144, in OverpassResult.__get(self, prop)
    143 def __get(self, prop):
--> 144     return self._json[prop] if prop in self._json else None

https://github.com/mocnik-science/osm-python-tools/blob/695ac4f6b9ee1c6ea4071b6dce28160687fd18c8/OSMPythonTools/internal/cacheObject.py#L50

https://github.com/mocnik-science/osm-python-tools/blob/695ac4f6b9ee1c6ea4071b6dce28160687fd18c8/OSMPythonTools/overpass.py#L77-L78

https://github.com/mocnik-science/osm-python-tools/blob/695ac4f6b9ee1c6ea4071b6dce28160687fd18c8/OSMPythonTools/overpass.py#L124-L126

https://github.com/mocnik-science/osm-python-tools/blob/695ac4f6b9ee1c6ea4071b6dce28160687fd18c8/OSMPythonTools/overpass.py#L143-L144