diff --git a/exports/exports_factory.py b/exports/exports_factory.py index cac694a8..a2fafa60 100644 --- a/exports/exports_factory.py +++ b/exports/exports_factory.py @@ -22,7 +22,7 @@ class ExportsFactory: @property def _citygml(self): """ - Export to citygml with application domain extensions + Export to citygml_classes with application domain extensions :return: None """ raise NotImplementedError @@ -30,7 +30,7 @@ class ExportsFactory: @property def _energy_ade(self): """ - Export to citygml with application domain extensions + Export to citygml_classes with application domain extensions :return: None """ return EnergyAde(self._city, self._path) diff --git a/imports/geometry/citygml.py b/imports/geometry/citygml.py index 0c652de6..f6d170bb 100644 --- a/imports/geometry/citygml.py +++ b/imports/geometry/citygml.py @@ -1,16 +1,15 @@ """ -CityGml module parses citygml files and import the geometry into the city model structure +CityGml module parses citygml_classes files and import the geometry into the city model structure SPDX - License - Identifier: LGPL - 3.0 - or -later Copyright © 2020 Project Author Guille Gutierrez guillermo.gutierrezmorote@concordia.ca """ import numpy as np import xmltodict - from city_model_structure.city import City from city_model_structure.building import Building from helpers.geometry_helper import GeometryHelper -from imports.geometry.citygml_lod2 import CityGmlLod2 -from imports.geometry.citygml_lod1 import CityGmlLod1 +from imports.geometry.citygml_classes.citygml_lod2 import CityGmlLod2 +from imports.geometry.citygml_classes.citygml_lod1 import CityGmlLod1 from city_model_structure.parts_consisting_building import PartsConsistingBuilding @@ -23,7 +22,7 @@ class CityGml: self._lod1_tags = ['lod1Solid', 'lod1MultiSurface'] self._lod2_tags = ['lod2Solid', 'lod2MultiSurface', 'lod2MultiCurve'] with open(path) as gml: - # Clean the namespaces is an important task to prevent wrong ns:field due poor citygml implementations + # Clean the namespaces is an important task to prevent wrong ns:field due poor citygml_classes implementations fl = ('cityObjectMember', 'curveMember', 'boundedBy', 'surfaceMember', 'consistsOfBuildingPart') self._gml = xmltodict.parse(gml.read(), process_namespaces=True, xml_attribs=True, namespaces={ 'http://www.opengis.net/gml': None, @@ -59,7 +58,6 @@ class CityGml: self._upper_corner = np.fromstring(envelope['upperCorner'], dtype=float, sep=' ') if '@srsName' in envelope: self._srs_name = envelope['@srsName'] - print(f'gmlread {path}') @property def content(self): @@ -95,7 +93,6 @@ class CityGml: print(f'add city building part {building.name}') self._city.add_city_object(building) building_parts.append(building) - print(f'add building cluster {name}') return PartsConsistingBuilding(name, building_parts) @property @@ -110,7 +107,6 @@ class CityGml: for o in self._gml['CityModel']['cityObjectMember']: city_object = o['Building'] if 'consistsOfBuildingPart' in city_object: - print('create building parts') self._city.add_city_objects_cluster(self._create_parts_consisting_building(city_object)) else: self._city.add_city_object(self._create_building(city_object)) diff --git a/imports/geometry/citygml_base.py b/imports/geometry/citygml_classes/citygml_base.py similarity index 100% rename from imports/geometry/citygml_base.py rename to imports/geometry/citygml_classes/citygml_base.py diff --git a/imports/geometry/citygml_lod1.py b/imports/geometry/citygml_classes/citygml_lod1.py similarity index 88% rename from imports/geometry/citygml_lod1.py rename to imports/geometry/citygml_classes/citygml_lod1.py index 7c829442..b830e147 100644 --- a/imports/geometry/citygml_lod1.py +++ b/imports/geometry/citygml_classes/citygml_lod1.py @@ -1,10 +1,10 @@ """ -CityGmlLod1 module parses citygml files with level of detail 1 and import the geometry into the city model structure +CityGmlLod1 module parses citygml_classes 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_classes.citygml_base import CityGmlBase from city_model_structure.attributes.surface import Surface from city_model_structure.attributes.polygon import Polygon diff --git a/imports/geometry/citygml_lod2.py b/imports/geometry/citygml_classes/citygml_lod2.py similarity index 91% rename from imports/geometry/citygml_lod2.py rename to imports/geometry/citygml_classes/citygml_lod2.py index 8ad1ca42..768490ad 100644 --- a/imports/geometry/citygml_lod2.py +++ b/imports/geometry/citygml_classes/citygml_lod2.py @@ -1,10 +1,10 @@ """ -CityGmlLod1 module parses citygml files with level of detail 1 and import the geometry into the city model structure +CityGmlLod1 module parses citygml_classes 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_classes.citygml_base import CityGmlBase from city_model_structure.attributes.surface import Surface from city_model_structure.attributes.polygon import Polygon from imports.geometry.helpers.geometry_helper import GeometryHelper diff --git a/non_functional_tests/test_geometry_factory.py b/non_functional_tests/test_geometry_factory.py index 6cfc80b4..cf9e74ce 100644 --- a/non_functional_tests/test_geometry_factory.py +++ b/non_functional_tests/test_geometry_factory.py @@ -7,6 +7,8 @@ from pathlib import Path from unittest import TestCase from imports.geometry_factory import GeometryFactory from imports.geometry.helpers.geometry_helper import GeometryHelper +from city_model_structure.city import City +from exports.exports_factory import ExportsFactory class TestGeometryFactory(TestCase): @@ -47,7 +49,7 @@ class TestGeometryFactory(TestCase): raise NotImplementedError return new_function - # citygml + # citygml_classes def test_stuttgart_gml(self): file = 'ConcordiaSWGcampus.gml' city = self._get_citygml(file) diff --git a/tests/test_geometry_factory.py b/tests/test_geometry_factory.py index e7e7214f..e817d45c 100644 --- a/tests/test_geometry_factory.py +++ b/tests/test_geometry_factory.py @@ -32,7 +32,7 @@ class TestGeometryFactory(TestCase): def test_citygml_city_serialization(self): """ - Test the City from citygml serialization de-serialization + Test the City from citygml_classes serialization de-serialization :return: None """ file = 'lod2_buildings.gml'