From 62632126c7177c9d37af0945b507b42392fc098e Mon Sep 17 00:00:00 2001 From: Franz-Benjamin Mocnik Date: Mon, 14 Mar 2022 01:57:47 +0100 Subject: [PATCH] element: missing geometric information is downloaded when needed II --- OSMPythonTools/api.py | 2 +- OSMPythonTools/element.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/OSMPythonTools/api.py b/OSMPythonTools/api.py index c31d571..8fe067c 100755 --- a/OSMPythonTools/api.py +++ b/OSMPythonTools/api.py @@ -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): diff --git a/OSMPythonTools/element.py b/OSMPythonTools/element.py index 593f98f..9bac533 100644 --- a/OSMPythonTools/element.py +++ b/OSMPythonTools/element.py @@ -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=''' <''' + m['type'] + ''' id="''' + str(m['ref']) + '''"/> '''), 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