Reorganize the citygml classes
This commit is contained in:
parent
c1c0f598da
commit
47c4cbed65
|
@ -104,10 +104,14 @@ class CityGml:
|
|||
|
||||
if self._city is None:
|
||||
self._city = City(self._lower_corner, self._upper_corner, self._srs_name)
|
||||
i = 0
|
||||
for o in self._gml['CityModel']['cityObjectMember']:
|
||||
i += 1
|
||||
city_object = o['Building']
|
||||
if 'consistsOfBuildingPart' in city_object:
|
||||
self._city.add_city_objects_cluster(self._create_parts_consisting_building(city_object))
|
||||
else:
|
||||
self._city.add_city_object(self._create_building(city_object))
|
||||
if i < 4:
|
||||
break
|
||||
return self._city
|
||||
|
|
|
@ -32,7 +32,6 @@ class CityGmlLod2(CityGmlBase):
|
|||
def _surface_encoding(surfaces):
|
||||
if 'lod2MultiSurface' in surfaces:
|
||||
return 'lod2MultiSurface', 'MultiSurface'
|
||||
print(surfaces)
|
||||
raise NotImplementedError('unknown surface type')
|
||||
|
||||
@classmethod
|
||||
|
@ -46,7 +45,7 @@ class CityGmlLod2(CityGmlBase):
|
|||
try:
|
||||
surface_encoding, surface_subtype = cls._surface_encoding(b[surface_type])
|
||||
except NotImplementedError:
|
||||
print("Ignore bounded")
|
||||
|
||||
continue
|
||||
for member in b[surface_type][surface_encoding][surface_subtype]['surfaceMember']:
|
||||
if '@srsDimension' in member['Polygon']['exterior']['LinearRing']['posList']:
|
||||
|
|
|
@ -51,7 +51,7 @@ class TestGeometryFactory(TestCase):
|
|||
|
||||
# citygml_classes
|
||||
def test_stuttgart_gml(self):
|
||||
file = 'ConcordiaSWGcampus.gml'
|
||||
file = 'concordia.gml'
|
||||
city = self._get_citygml(file)
|
||||
print(f'city name: {city}')
|
||||
for building in city.buildings:
|
||||
|
|
Loading…
Reference in New Issue
Block a user