Skip to content

Commit

Permalink
element: missing geometric information is downloaded when needed II
Browse files Browse the repository at this point in the history
  • Loading branch information
franz-benjamin committed Mar 14, 2022
1 parent d1c0a4e commit 6263212
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion OSMPythonTools/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def __init__(self, xml, queryString, params, cacheMetadata=None, shallow=False,

def _unshallow(self):
api = SingletonApi()
x = api.query(self.type() + '/' + str(self.id()))
x = api.query(self.type() + '/' + str(self.id()) + ('/full' if self.type() != 'node' else ''))
self.__init__(x._xml, x._queryString, x._params)

def isValid(self):
Expand Down
4 changes: 2 additions & 2 deletions OSMPythonTools/element.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,14 +133,14 @@ def members(self, shallow=True, onlyInner=False, onlyOuter=False):
return []
api = SingletonApi()
if shallow:
return list(map(lambda m: api.query(m['type'] + '/' + str(m['ref']), shallow='''
return list(map(lambda m: api.query(m['type'] + '/' + str(m['ref']) + '/full', shallow='''
<?xml version="1.0" encoding="UTF-8"?>
<osm>
<''' + m['type'] + ''' id="''' + str(m['ref']) + '''"/>
</osm>
'''), members))
else:
return list(map(lambda m: api.query(m['type'] + '/' + str(m['ref'])), members))
return list(map(lambda m: api.query(m['type'] + '/' + str(m['ref']) + '/full'), members))
def countMembers(self):
members = self.__members()
return len(members) if members is not None else None
Expand Down

0 comments on commit 6263212

Please sign in to comment.