Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overpass shallow query results in an error #68

Open
RaczeQ opened this issue Nov 7, 2022 · 0 comments
Open

Overpass shallow query results in an error #68

RaczeQ opened this issue Nov 7, 2022 · 0 comments

Comments

@RaczeQ
Copy link

RaczeQ commented Nov 7, 2022

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

result = self._rawToResult(data['response'], queryString, params, kwargs, cacheMetadata=cacheMetadata, shallow=shallow)

def _rawToResult(self, data, queryString, params, kwargs, cacheMetadata=None, shallow=False):
return OverpassResult(data, queryString, params, cacheMetadata=cacheMetadata)

class OverpassResult(Response):
def __init__(self, json, queryString, params, cacheMetadata=None):
self._json = json

def __get(self, prop):
return self._json[prop] if prop in self._json else None

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant