25 lines
1.2 KiB
Python
25 lines
1.2 KiB
Python
|
from imports.geometry.citygml_tools import CityGmlTools
|
||
|
from city_model_structure.attributes.surface import Surface
|
||
|
from city_model_structure.attributes.polygon import Polygon
|
||
|
|
||
|
|
||
|
class CityGmlLod1(CityGmlTools):
|
||
|
|
||
|
@staticmethod
|
||
|
def lod1_solid(o):
|
||
|
try:
|
||
|
solid_points = [
|
||
|
CityGmlTools._solid_points(CityGmlTools._remove_last_point(s['Polygon']['exterior']['LinearRing']['posList']['#text']))
|
||
|
for s in o['Building']['lod1Solid']['Solid']['exterior']['CompositeSurface']['surfaceMember']]
|
||
|
except TypeError:
|
||
|
solid_points = [
|
||
|
CityGmlTools._solid_points(CityGmlTools._remove_last_point(s['Polygon']['exterior']['LinearRing']['posList']))
|
||
|
for s in o['Building']['lod1Solid']['Solid']['exterior']['CompositeSurface']['surfaceMember']]
|
||
|
|
||
|
return [Surface(Polygon(sp), Polygon(sp)) for sp in solid_points]
|
||
|
|
||
|
@staticmethod
|
||
|
def lod1_multi_surface(o):
|
||
|
solid_points = [CityGmlTools._solid_points(CityGmlTools._remove_last_point(s['Polygon']['exterior']['LinearRing']['posList']))
|
||
|
for s in o['Building']['lod1MultiSurface']['MultiSurface']['surfaceMember']]
|
||
|
return [Surface(Polygon(sp), Polygon(sp)) for sp in solid_points]
|