Correct bug in citygml year_of_construction field default value

This commit is contained in:
Guille Gutierrez 2023-02-23 15:40:09 -05:00
parent c5110585c7
commit 511361b70b
2 changed files with 8 additions and 5 deletions

View File

@ -19,11 +19,12 @@ class CityGml:
""" """
CityGml class CityGml class
""" """
def __init__(self, def __init__(self,
path, path,
extrusion_height_field=None, extrusion_height_field=None,
year_of_construction_field='yearOfConstruction', year_of_construction_field=None,
function_field='function', function_field=None,
function_to_hub=None): function_to_hub=None):
self._city = None self._city = None
self._lod = None self._lod = None
@ -31,9 +32,12 @@ class CityGml:
self._lod2_tags = ['lod2Solid', 'lod2MultiSurface', 'lod2MultiCurve'] self._lod2_tags = ['lod2Solid', 'lod2MultiSurface', 'lod2MultiCurve']
self._extrusion_height_field = extrusion_height_field self._extrusion_height_field = extrusion_height_field
self._function_to_hub = function_to_hub self._function_to_hub = function_to_hub
self._year_of_construction_field = year_of_construction_field
if function_field is None: if function_field is None:
function_field = 'function' function_field = 'function'
if year_of_construction_field is None:
year_of_construction_field = 'yearOfConstruction'
self._year_of_construction_field = year_of_construction_field
self._function_field = function_field self._function_field = function_field
self._lower_corner = None self._lower_corner = None

View File

@ -103,12 +103,11 @@ class TestGeometryFactory(TestCase):
:return: None :return: None
""" """
file = 'FZK_Haus_LoD_2.gml' file = 'FZK_Haus_LoD_2.gml'
city = self._get_city(file, 'citygml', year_of_construction_field='yearOfConstruction') city = self._get_city(file, 'citygml')
self.assertTrue(len(city.buildings) == 1) self.assertTrue(len(city.buildings) == 1)
self._check_buildings(city) self._check_buildings(city)
for building in city.buildings: for building in city.buildings:
self._check_surfaces(building) self._check_surfaces(building)
building.year_of_construction = 2006
city = ConstructionFactory('nrel', city).enrich() city = ConstructionFactory('nrel', city).enrich()
def test_import_rhino(self): def test_import_rhino(self):