Remove debug prints

This commit is contained in:
Guille Gutierrez 2020-06-22 14:41:20 -04:00
parent 254def746a
commit 852c7bf8cf
2 changed files with 1 additions and 9 deletions

View File

@ -19,4 +19,4 @@ shortwave_reflectance = 0.8
min_air_change = 0.5 min_air_change = 0.5
[buildings] [buildings]
max_location_distance_for_shared_walls = 200.0 max_location_distance_for_shared_walls = 100.0

View File

@ -18,7 +18,6 @@ class CityGml:
CityGml class CityGml class
""" """
def __init__(self, path): def __init__(self, path):
start = datetime.utcnow()
self._city = None self._city = None
with open(path) as gml: with open(path) as gml:
# Clean the namespaces is an important task to prevent wrong ns:field due poor citygml implementations # Clean the namespaces is an important task to prevent wrong ns:field due poor citygml implementations
@ -54,7 +53,6 @@ class CityGml:
self._upper_corner = np.fromstring(envelope['upperCorner'], dtype=float, sep=' ') self._upper_corner = np.fromstring(envelope['upperCorner'], dtype=float, sep=' ')
self._srs_name = envelope['@srsName'] self._srs_name = envelope['@srsName']
print('city_gml constructor', datetime.utcnow() - start)
@property @property
def content(self): def content(self):
@ -71,7 +69,6 @@ class CityGml:
:return: City :return: City
""" """
if self._city is None: if self._city is None:
start = datetime.utcnow()
self._city = City(self._lower_corner, self._upper_corner, self._srs_name) self._city = City(self._lower_corner, self._upper_corner, self._srs_name)
i = 0 i = 0
for o in self._gml['CityModel']['cityObjectMember']: for o in self._gml['CityModel']['cityObjectMember']:
@ -85,17 +82,13 @@ class CityGml:
for bound in o['Building']['boundedBy']: for bound in o['Building']['boundedBy']:
surface_type = next(iter(bound)) surface_type = next(iter(bound))
if 'lod2MultiSurface' in bound[surface_type]: if 'lod2MultiSurface' in bound[surface_type]:
start = datetime.utcnow()
lod = 2 lod = 2
surfaces = CityGml._lod2(bound) surfaces = CityGml._lod2(bound)
print('lod2 ', surface_type, datetime.utcnow() - start)
if 'lod3Solid' in o['Building']: if 'lod3Solid' in o['Building']:
lod += 4 lod += 4
if 'lod4Solid' in o['Building']: if 'lod4Solid' in o['Building']:
lod += 8 lod += 8
name = o['Building']['@id'] name = o['Building']['@id']
lod_terrain_str = 'lod' + str(lod) + 'TerrainIntersection' lod_terrain_str = 'lod' + str(lod) + 'TerrainIntersection'
terrains = [] terrains = []
if lod_terrain_str in o['Building']: if lod_terrain_str in o['Building']:
@ -161,5 +154,4 @@ class CityGml:
surfaces = [Surface(s['Polygon']['exterior']['LinearRing']['posList'], surfaces = [Surface(s['Polygon']['exterior']['LinearRing']['posList'],
surface_type=GeometryHelper.gml_surface_to_libs(surface_type)) surface_type=GeometryHelper.gml_surface_to_libs(surface_type))
for s in bound[surface_type]['lod2MultiSurface']['MultiSurface']['surfaceMember']] for s in bound[surface_type]['lod2MultiSurface']['MultiSurface']['surfaceMember']]
print(len(surfaces), 'surfaces')
return surfaces return surfaces