41 lines
1.4 KiB
Python
41 lines
1.4 KiB
Python
from imports.geometry.citygml_base import CityGmlBase
|
|
from city_model_structure.attributes.surface import Surface
|
|
from city_model_structure.attributes.polygon import Polygon
|
|
|
|
|
|
class CityGmlLod1(CityGmlBase):
|
|
|
|
@classmethod
|
|
def _multi_curve(cls, o):
|
|
pass
|
|
|
|
@classmethod
|
|
def _multi_surface(cls, o):
|
|
pass
|
|
|
|
@classmethod
|
|
def _solid(cls, o):
|
|
pass
|
|
|
|
def __init__(self, o):
|
|
super().__init__()
|
|
self._o = o
|
|
|
|
@staticmethod
|
|
def lod1_solid(o):
|
|
try:
|
|
solid_points = [
|
|
CityGmlBase._solid_points(CityGmlBase._remove_last_point(s['Polygon']['exterior']['LinearRing']['posList']['#text']))
|
|
for s in o['Building']['lod1Solid']['Solid']['exterior']['CompositeSurface']['surfaceMember']]
|
|
except TypeError:
|
|
solid_points = [
|
|
CityGmlBase._solid_points(CityGmlBase._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 = [CityGmlBase._solid_points(CityGmlBase._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] |