Improve comments

This commit is contained in:
Guille Gutierrez 2021-06-03 11:27:48 -04:00
parent 62a1dbbf7f
commit 23360021c3
4 changed files with 32 additions and 8 deletions

View File

@ -81,7 +81,7 @@ class CityGml:
surfaces = CityGmlLod2(city_object).surfaces surfaces = CityGmlLod2(city_object).surfaces
else: else:
raise NotImplementedError("Not supported level of detail") raise NotImplementedError("Not supported level of detail")
return Building(name, lod, surfaces, year_of_construction, function, self._lower_corner,[]) return Building(name, lod, surfaces, year_of_construction, function, self._lower_corner, [])
def _create_parts_consisting_building(self): def _create_parts_consisting_building(self):
raise NotImplementedError raise NotImplementedError

View File

@ -1,14 +1,26 @@
"""
CityGmlBase module abstract class to template the different level of details
SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2021 Project Author Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
"""
from abc import ABC from abc import ABC
import numpy as np import numpy as np
from imports.geometry.helpers.geometry_helper import GeometryHelper from imports.geometry.helpers.geometry_helper import GeometryHelper
class CityGmlBase(ABC): class CityGmlBase(ABC):
"""
CityGmlBase class inherited by the specific level of detail classes.
"""
def __init__(self): def __init__(self):
self._surfaces = [] self._surfaces = []
@property @property
def surfaces(self): def surfaces(self):
"""
parsed surfaces
"""
return self._surfaces return self._surfaces
@staticmethod @staticmethod
@ -19,11 +31,6 @@ class CityGmlBase(ABC):
@staticmethod @staticmethod
def _solid_points(coordinates) -> np.ndarray: def _solid_points(coordinates) -> np.ndarray:
"""
Solid surface point matrix [[x, y, z],[x, y, z],...]
:parameter coordinates: string from file
:return: np.ndarray
"""
solid_points = np.fromstring(coordinates, dtype=float, sep=' ') solid_points = np.fromstring(coordinates, dtype=float, sep=' ')
solid_points = GeometryHelper.to_points_matrix(solid_points) solid_points = GeometryHelper.to_points_matrix(solid_points)
return solid_points return solid_points

View File

@ -1,9 +1,18 @@
"""
CityGmlLod1 module parses citygml files with level of detail 1 and import the geometry into the city model structure
SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2021 Project Author Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
"""
from imports.geometry.citygml_base import CityGmlBase from imports.geometry.citygml_base import CityGmlBase
from city_model_structure.attributes.surface import Surface from city_model_structure.attributes.surface import Surface
from city_model_structure.attributes.polygon import Polygon from city_model_structure.attributes.polygon import Polygon
class CityGmlLod1(CityGmlBase): class CityGmlLod1(CityGmlBase):
"""
CityGmlLod1 class to parse level of detail 1 city gml files
"""
@classmethod @classmethod
def _multi_curve(cls, o): def _multi_curve(cls, o):

View File

@ -1,3 +1,9 @@
"""
CityGmlLod1 module parses citygml files with level of detail 1 and import the geometry into the city model structure
SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2021 Project Author Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
"""
from imports.geometry.citygml_base import CityGmlBase from imports.geometry.citygml_base import CityGmlBase
from city_model_structure.attributes.surface import Surface from city_model_structure.attributes.surface import Surface
from city_model_structure.attributes.polygon import Polygon from city_model_structure.attributes.polygon import Polygon
@ -5,7 +11,9 @@ from imports.geometry.helpers.geometry_helper import GeometryHelper
class CityGmlLod2(CityGmlBase): class CityGmlLod2(CityGmlBase):
"""
CityGmlLod1 class to parse level of detail 1 city gml files
"""
def __init__(self, o): def __init__(self, o):
super().__init__() super().__init__()
self._o = o self._o = o