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
else:
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):
raise NotImplementedError
@ -101,4 +101,4 @@ class CityGml:
raise NotImplementedError("Building cluster")
else:
self._city.add_city_object(self._create_building(city_object))
return self._city
return self._city

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
import numpy as np
from imports.geometry.helpers.geometry_helper import GeometryHelper
class CityGmlBase(ABC):
"""
CityGmlBase class inherited by the specific level of detail classes.
"""
def __init__(self):
self._surfaces = []
@property
def surfaces(self):
"""
parsed surfaces
"""
return self._surfaces
@staticmethod
@ -19,11 +31,6 @@ class CityGmlBase(ABC):
@staticmethod
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 = GeometryHelper.to_points_matrix(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 city_model_structure.attributes.surface import Surface
from city_model_structure.attributes.polygon import Polygon
class CityGmlLod1(CityGmlBase):
"""
CityGmlLod1 class to parse level of detail 1 city gml files
"""
@classmethod
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 city_model_structure.attributes.surface import Surface
from city_model_structure.attributes.polygon import Polygon
@ -5,7 +11,9 @@ from imports.geometry.helpers.geometry_helper import GeometryHelper
class CityGmlLod2(CityGmlBase):
"""
CityGmlLod1 class to parse level of detail 1 city gml files
"""
def __init__(self, o):
super().__init__()
self._o = o