Merge branch 'master' into bugs_in_meb_exporter
This commit is contained in:
commit
82cb38098d
|
@ -20,8 +20,8 @@ class Building(CityObject):
|
|||
"""
|
||||
Building(CityObject) class
|
||||
"""
|
||||
def __init__(self, name, surfaces, year_of_construction, function, city_lower_corner, terrains=None):
|
||||
super().__init__(name, surfaces, city_lower_corner)
|
||||
def __init__(self, name, surfaces, year_of_construction, function, terrains=None):
|
||||
super().__init__(name, surfaces)
|
||||
self._households = None
|
||||
self._basement_heated = None
|
||||
self._attic_heated = None
|
||||
|
|
|
@ -82,6 +82,8 @@ class City:
|
|||
if self._location is None:
|
||||
gps = pyproj.CRS('EPSG:4326') # LatLon with WGS84 datum used by GPS units and Google Earth
|
||||
try:
|
||||
if self._srs_name in GeometryHelper.srs_transformations.keys():
|
||||
self._srs_name = GeometryHelper.srs_transformations[self._srs_name]
|
||||
input_reference = pyproj.CRS(self.srs_name) # Projected coordinate system from input data
|
||||
except pyproj.exceptions.CRSError:
|
||||
sys.stderr.write('Invalid projection reference system, please check the input data. '
|
||||
|
@ -106,7 +108,9 @@ class City:
|
|||
Get city name
|
||||
:return: str
|
||||
"""
|
||||
return self._get_location().city
|
||||
if self._name is None:
|
||||
return self._get_location().city
|
||||
return self._name
|
||||
|
||||
@property
|
||||
def climate_reference_city(self) -> Union[None, str]:
|
||||
|
@ -451,5 +455,5 @@ class City:
|
|||
return _merge_city
|
||||
|
||||
@property
|
||||
def level_of_detail(self):
|
||||
def level_of_detail(self) -> LevelOfDetail:
|
||||
return self._level_of_detail
|
||||
|
|
|
@ -18,10 +18,9 @@ class CityObject:
|
|||
"""
|
||||
class CityObject
|
||||
"""
|
||||
def __init__(self, name, surfaces, city_lower_corner):
|
||||
def __init__(self, name, surfaces):
|
||||
self._name = name
|
||||
self._surfaces = surfaces
|
||||
self._city_lower_corner = city_lower_corner
|
||||
self._type = None
|
||||
self._city_object_lower_corner = None
|
||||
self._detailed_polyhedron = None
|
||||
|
@ -226,3 +225,5 @@ class CityObject:
|
|||
:param value: [Sensor]
|
||||
"""
|
||||
self._sensors = value
|
||||
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ class CityObjectsCluster(ABC, CityObject):
|
|||
self._cluster_type = cluster_type
|
||||
self._city_objects = city_objects
|
||||
self._sensors = []
|
||||
super().__init__(name, None, None)
|
||||
super().__init__(name, None)
|
||||
|
||||
@property
|
||||
def name(self):
|
||||
|
|
|
@ -16,8 +16,8 @@ class EnergySystem(CityObject):
|
|||
EnergySystem(CityObject) class
|
||||
"""
|
||||
|
||||
def __init__(self, name, surfaces, city_lower_corner):
|
||||
super().__init__(name, surfaces, city_lower_corner)
|
||||
def __init__(self, name, surfaces):
|
||||
super().__init__(name, surfaces)
|
||||
self._air_source_hp = None
|
||||
self._water_to_water_hp = None
|
||||
self._type = 'energy_system'
|
||||
|
|
|
@ -12,7 +12,7 @@ class SubwayEntrance(CityObject):
|
|||
SubwayEntrance(CityObject) class
|
||||
"""
|
||||
def __init__(self, name, latitude, longitude):
|
||||
super().__init__(0, [], name, [])
|
||||
super().__init__(name, 0, [])
|
||||
self._name = name
|
||||
self._latitude = latitude
|
||||
self._longitude = longitude
|
||||
|
|
|
@ -119,6 +119,7 @@ class Idf:
|
|||
self._adjacent_buildings = []
|
||||
self._export()
|
||||
|
||||
|
||||
@staticmethod
|
||||
def _matrix_to_list(points, lower_corner):
|
||||
lower_x = lower_corner[0]
|
||||
|
|
|
@ -81,4 +81,4 @@ class ExportsFactory:
|
|||
Export the city given to the class using the given export type handler
|
||||
:return: None
|
||||
"""
|
||||
return getattr(self, self._export_type)
|
||||
return Obj(self._city, self._path)
|
||||
|
|
|
@ -6,7 +6,6 @@ Project Coder Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca
|
|||
"""
|
||||
|
||||
# universal constants
|
||||
import sys
|
||||
|
||||
KELVIN = 273.15
|
||||
|
||||
|
|
|
@ -20,6 +20,9 @@ class GeometryHelper:
|
|||
"""
|
||||
Geometry helper class
|
||||
"""
|
||||
srs_transformations = {
|
||||
'urn:adv:crs:ETRS89_UTM32*DE_DHHN92_NH': 'epsg:25832'
|
||||
}
|
||||
|
||||
def __init__(self, delta=0, area_delta=0):
|
||||
self._delta = delta
|
||||
|
|
|
@ -74,7 +74,7 @@ class UsPhysicsParameters(NrelPhysicsInterface):
|
|||
if (str(function) == str(building_archetype.function)) and \
|
||||
(climate_zone == str(building_archetype.climate_zone)):
|
||||
return building_archetype
|
||||
return None
|
||||
raise KeyError('archetype not found')
|
||||
|
||||
@staticmethod
|
||||
def _search_construction_in_archetype(archetype, construction_type):
|
||||
|
|
|
@ -32,3 +32,10 @@ class ConstructionFactory:
|
|||
:return: None
|
||||
"""
|
||||
getattr(self, self._handler, lambda: None)()
|
||||
|
||||
def enrich_debug(self):
|
||||
"""
|
||||
Enrich the city given to the class using the class given handler
|
||||
:return: None
|
||||
"""
|
||||
UsPhysicsParameters(self._city, self._base_path).enrich_buildings()
|
|
@ -82,7 +82,7 @@ class AirSourceHeatPumpParameters:
|
|||
heat_pump.heating_comp_power = h_data[1]
|
||||
heat_pump.heating_capacity_coff = self._compute_coefficients(h_data)
|
||||
|
||||
energy_system = EnergySystem('{} capacity heat pump'.format(heat_pump.model), [], None)
|
||||
energy_system = EnergySystem('{} capacity heat pump'.format(heat_pump.model), [])
|
||||
energy_system.air_source_hp = heat_pump
|
||||
self._city.add_city_object(energy_system)
|
||||
return self._city
|
||||
|
|
|
@ -129,7 +129,7 @@ class WaterToWaterHPParameters:
|
|||
heat_pump.entering_water_temp = data['ewt']
|
||||
heat_pump.leaving_water_temp = data['lwt']
|
||||
heat_pump.power_demand_coff = self._compute_coefficients(data)
|
||||
energy_system = EnergySystem(heat_pump.model, [], None)
|
||||
energy_system = EnergySystem(heat_pump.model, [])
|
||||
energy_system.water_to_water_hp = heat_pump
|
||||
self._city.add_city_object(energy_system)
|
||||
return self._city
|
||||
|
|
|
@ -21,11 +21,14 @@ class CityGml:
|
|||
"""
|
||||
CityGml class
|
||||
"""
|
||||
def __init__(self, path):
|
||||
def __init__(self, path, extrusion_height_field=None, year_of_construction_field=None, function_field=None):
|
||||
self._city = None
|
||||
self._lod = None
|
||||
self._lod1_tags = ['lod1Solid', 'lod1MultiSurface']
|
||||
self._lod2_tags = ['lod2Solid', 'lod2MultiSurface', 'lod2MultiCurve']
|
||||
self._extrusion_height_field = extrusion_height_field
|
||||
self._year_of_construction_field = year_of_construction_field
|
||||
self._function_field = function_field
|
||||
self._lower_corner = None
|
||||
self._upper_corner = None
|
||||
with open(path) as gml:
|
||||
|
@ -65,6 +68,9 @@ class CityGml:
|
|||
self._upper_corner = np.fromstring(envelope['upperCorner'], dtype=float, sep=' ')
|
||||
if '@srsName' in envelope:
|
||||
self._srs_name = envelope['@srsName']
|
||||
else:
|
||||
# If not coordinate system given assuming hub standard
|
||||
self._srs_name = "EPSG:26911"
|
||||
else:
|
||||
# get the boundary from the city objects instead
|
||||
for city_object_member in self._gml['CityModel']['cityObjectMember']:
|
||||
|
@ -118,7 +124,7 @@ class CityGml:
|
|||
surfaces = CityGmlLod2(city_object).surfaces
|
||||
else:
|
||||
raise NotImplementedError("Not supported level of detail")
|
||||
return Building(name, surfaces, year_of_construction, function, self._lower_corner, terrains=None)
|
||||
return Building(name, surfaces, year_of_construction, function, terrains=None)
|
||||
|
||||
def _create_parts_consisting_building(self, city_object):
|
||||
name = city_object['@id']
|
||||
|
|
|
@ -24,18 +24,6 @@ class CityGmlBase(ABC):
|
|||
"""
|
||||
return self._surfaces
|
||||
|
||||
@staticmethod
|
||||
def _remove_last_point(points):
|
||||
array = points.split(' ')
|
||||
res = " "
|
||||
return res.join(array[0:len(array) - 3])
|
||||
|
||||
@staticmethod
|
||||
def _solid_points(coordinates) -> np.ndarray:
|
||||
solid_points = np.fromstring(coordinates, dtype=float, sep=' ')
|
||||
solid_points = GeometryHelper.to_points_matrix(solid_points)
|
||||
return solid_points
|
||||
|
||||
@classmethod
|
||||
def _solid(cls, city_object_member):
|
||||
raise NotImplementedError
|
||||
|
|
|
@ -6,6 +6,7 @@ Copyright © 2022 Concordia CERC group
|
|||
Project Coder Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
|
||||
"""
|
||||
|
||||
from imports.geometry.helpers.geometry_helper import GeometryHelper
|
||||
from imports.geometry.citygml_classes.citygml_base import CityGmlBase
|
||||
from city_model_structure.building_demand.surface import Surface
|
||||
from city_model_structure.attributes.polygon import Polygon
|
||||
|
@ -37,19 +38,20 @@ class CityGmlLod1(CityGmlBase):
|
|||
def _solid(cls, city_object_member):
|
||||
try:
|
||||
solid_points = [
|
||||
CityGmlBase._solid_points(CityGmlBase._remove_last_point(s['Polygon']['exterior']['LinearRing']['posList']
|
||||
['#text']))
|
||||
GeometryHelper.points_from_string(GeometryHelper.remove_last_point_from_string(
|
||||
s['Polygon']['exterior']['LinearRing']['posList']['#text']))
|
||||
for s in city_object_member['lod1Solid']['Solid']['exterior']['CompositeSurface']['surfaceMember']]
|
||||
except TypeError:
|
||||
solid_points = [
|
||||
CityGmlBase._solid_points(CityGmlBase._remove_last_point(s['Polygon']['exterior']['LinearRing']['posList']))
|
||||
GeometryHelper.points_from_string(GeometryHelper.remove_last_point_from_string(
|
||||
s['Polygon']['exterior']['LinearRing']['posList']))
|
||||
for s in city_object_member['lod1Solid']['Solid']['exterior']['CompositeSurface']['surfaceMember']]
|
||||
|
||||
return [Surface(Polygon(sp), Polygon(sp)) for sp in solid_points]
|
||||
|
||||
@classmethod
|
||||
def _multi_surface(cls, city_object_member):
|
||||
solid_points = [CityGmlBase._solid_points(CityGmlBase._remove_last_point(s['Polygon']['exterior']['LinearRing']
|
||||
['posList']))
|
||||
solid_points = [GeometryHelper.points_from_string(GeometryHelper.remove_last_point_from_string(
|
||||
s['Polygon']['exterior']['LinearRing']['posList']))
|
||||
for s in city_object_member['Building']['lod1MultiSurface']['MultiSurface']['surfaceMember']]
|
||||
return [Surface(Polygon(sp), Polygon(sp)) for sp in solid_points]
|
||||
|
|
|
@ -60,11 +60,19 @@ class CityGmlLod2(CityGmlBase):
|
|||
|
||||
@classmethod
|
||||
def _add_member_surface(cls, member, surface_type):
|
||||
if '@srsDimension' in member['Polygon']['exterior']['LinearRing']['posList']:
|
||||
pos_name = 'posList'
|
||||
if pos_name not in member['Polygon']['exterior']['LinearRing']:
|
||||
pos_name = 'pos'
|
||||
if '@srsDimension' in member['Polygon']['exterior']['LinearRing'][pos_name]:
|
||||
gml_points = member['Polygon']['exterior']['LinearRing']['posList']["#text"]
|
||||
else:
|
||||
gml_points = member['Polygon']['exterior']['LinearRing']['posList']
|
||||
solid_points = cls._solid_points(cls._remove_last_point(gml_points))
|
||||
gml_points = member['Polygon']['exterior']['LinearRing'][pos_name]
|
||||
if pos_name == 'pos':
|
||||
gml_points_string = ''
|
||||
for gml_point in gml_points:
|
||||
gml_points_string = f'{gml_points_string} {gml_point}'
|
||||
gml_points = gml_points_string.lstrip(' ')
|
||||
solid_points = GeometryHelper.points_from_string(GeometryHelper.remove_last_point_from_string(gml_points))
|
||||
polygon = Polygon(solid_points)
|
||||
return Surface(polygon, polygon, surface_type=GeometryHelper.gml_surface_to_libs(surface_type))
|
||||
|
||||
|
|
149
imports/geometry/geojson.py
Normal file
149
imports/geometry/geojson.py
Normal file
|
@ -0,0 +1,149 @@
|
|||
"""
|
||||
Geojson module parses geojson files and import the geometry into the city model structure
|
||||
SPDX - License - Identifier: LGPL - 3.0 - or -later
|
||||
Copyright © 2022 Concordia CERC group
|
||||
Project Coder Guillermo Gutierrez Guillermo.GutierrezMorote@concordia.ca
|
||||
"""
|
||||
import json
|
||||
|
||||
import trimesh.creation
|
||||
import numpy as np
|
||||
|
||||
from pyproj import Transformer
|
||||
from shapely.geometry import Polygon as ShapelyPolygon
|
||||
|
||||
import helpers.constants as cte
|
||||
from imports.geometry.helpers.geometry_helper import GeometryHelper
|
||||
from city_model_structure.attributes.polygon import Polygon
|
||||
from city_model_structure.building import Building
|
||||
from city_model_structure.building_demand.surface import Surface
|
||||
from city_model_structure.city import City
|
||||
|
||||
|
||||
class Geojson:
|
||||
"""
|
||||
Geojson class
|
||||
"""
|
||||
X = 0
|
||||
Y = 1
|
||||
|
||||
def __init__(self, path, extrusion_height_field=None, year_of_construction_field=None, function_field=None):
|
||||
# todo: destination epsg should change according actual the location
|
||||
self._transformer = Transformer.from_crs('epsg:4326', 'epsg:26911')
|
||||
self._min_x = cte.MAX_FLOAT
|
||||
self._min_y = cte.MAX_FLOAT
|
||||
self._max_x = cte.MIN_FLOAT
|
||||
self._max_y = cte.MIN_FLOAT
|
||||
self._max_z = 0
|
||||
self._city = None
|
||||
self._extrusion_height_field = extrusion_height_field
|
||||
self._year_of_construction_field = year_of_construction_field
|
||||
self._function_field = function_field
|
||||
with open(path) as json_file:
|
||||
self._geojson = json.loads(json_file.read())
|
||||
|
||||
def _save_bounds(self, x, y):
|
||||
if x > self._max_x:
|
||||
self._max_x = x
|
||||
if x < self._min_x:
|
||||
self._min_x = x
|
||||
if y > self._max_y:
|
||||
self._max_y = y
|
||||
if y < self._min_y:
|
||||
self._min_y = y
|
||||
|
||||
@staticmethod
|
||||
def _create_buildings_lod0(name, year_of_construction, function, surfaces_coordinates):
|
||||
surfaces = []
|
||||
buildings = []
|
||||
for zone, surface_coordinates in enumerate(surfaces_coordinates):
|
||||
points = GeometryHelper.points_from_string(GeometryHelper.remove_last_point_from_string(surface_coordinates))
|
||||
polygon = Polygon(points)
|
||||
surfaces.append(Surface(polygon, polygon))
|
||||
buildings.append(Building(f'{name}_zone_{zone}', surfaces, year_of_construction, function))
|
||||
return buildings
|
||||
|
||||
@staticmethod
|
||||
def _create_buildings_lod1(name, year_of_construction, function, height, surface_coordinates):
|
||||
lod0_buildings = Geojson._create_buildings_lod0(name, year_of_construction, function, surface_coordinates)
|
||||
surfaces = []
|
||||
buildings = []
|
||||
for zone, lod0_building in enumerate(lod0_buildings):
|
||||
for surface in lod0_building.surfaces:
|
||||
shapely_polygon = ShapelyPolygon(surface.solid_polygon.coordinates)
|
||||
if not shapely_polygon.is_valid:
|
||||
print(surface.solid_polygon.area)
|
||||
print('error?', name, surface_coordinates)
|
||||
continue
|
||||
mesh = trimesh.creation.extrude_polygon(shapely_polygon, height)
|
||||
for face in mesh.faces:
|
||||
points = []
|
||||
for vertex_index in face:
|
||||
points.append(mesh.vertices[vertex_index])
|
||||
polygon = Polygon(points)
|
||||
surface = Surface(polygon, polygon)
|
||||
surfaces.append(surface)
|
||||
buildings.append(Building(f'{name}_zone_{zone}', surfaces, year_of_construction, function))
|
||||
return buildings
|
||||
|
||||
def _get_polygons(self, polygons, coordinates):
|
||||
if type(coordinates[0][self.X]) != float:
|
||||
polygons = []
|
||||
for element in coordinates:
|
||||
polygons = self._get_polygons(polygons, element)
|
||||
return polygons
|
||||
else:
|
||||
transformed_coordinates = ''
|
||||
for coordinate in coordinates:
|
||||
transformed = self._transformer.transform(coordinate[self.Y], coordinate[self.X])
|
||||
self._save_bounds(transformed[self.X], transformed[self.Y])
|
||||
transformed_coordinates = f'{transformed_coordinates} {transformed[self.X]} {transformed[self.Y]} 0.0'
|
||||
polygons.append(transformed_coordinates.lstrip(' '))
|
||||
return polygons
|
||||
|
||||
@property
|
||||
def city(self) -> City:
|
||||
"""
|
||||
Get city out of a Geojson file
|
||||
"""
|
||||
if self._city is None:
|
||||
buildings = []
|
||||
building_id = 0
|
||||
for feature in self._geojson['features']:
|
||||
extrusion_height = 0
|
||||
if self._extrusion_height_field is not None:
|
||||
extrusion_height = float(feature['properties'][self._extrusion_height_field])
|
||||
year_of_construction = None
|
||||
if self._year_of_construction_field is not None:
|
||||
year_of_construction = int(feature['properties'][self._year_of_construction_field])
|
||||
function = None
|
||||
if self._function_field is not None:
|
||||
function = feature['properties'][self._function_field]
|
||||
geometry = feature['geometry']
|
||||
if 'id' in feature:
|
||||
building_name = feature['id']
|
||||
else:
|
||||
building_name = f'building_{building_id}'
|
||||
building_id += 1
|
||||
polygons = []
|
||||
for part, coordinates in enumerate(geometry['coordinates']):
|
||||
polygons = self._get_polygons(polygons, coordinates)
|
||||
for zone, polygon in enumerate(polygons):
|
||||
if extrusion_height == 0:
|
||||
buildings = buildings + Geojson._create_buildings_lod0(f'{building_name}_part_{part}_zone{zone}',
|
||||
year_of_construction,
|
||||
function,
|
||||
[polygon])
|
||||
else:
|
||||
if self._max_z < extrusion_height:
|
||||
self._max_z = extrusion_height
|
||||
buildings = buildings + Geojson._create_buildings_lod1(f'{building_name}_part_{part}',
|
||||
year_of_construction,
|
||||
function,
|
||||
extrusion_height,
|
||||
[polygon])
|
||||
|
||||
self._city = City([self._min_x, self._min_y, 0.0], [self._max_x, self._max_y, self._max_z], 'epsg:26911')
|
||||
for building in buildings:
|
||||
self._city.add_city_object(building)
|
||||
return self._city
|
|
@ -40,7 +40,6 @@ class GPandas:
|
|||
self._scene = dataframe
|
||||
self._scene = self._scene.to_crs(self._srs_name)
|
||||
min_x, min_y, max_x, max_y = self._scene.total_bounds
|
||||
print(min_x)
|
||||
self._lower_corner = [min_x, min_y, 0]
|
||||
self._upper_corner = [max_x, max_y, 0]
|
||||
|
||||
|
@ -57,7 +56,6 @@ class GPandas:
|
|||
Get city out of a GeoPandas Table
|
||||
"""
|
||||
if self._city is None:
|
||||
lod = 1
|
||||
self._city = City(self._lower_corner, self._upper_corner, self._srs_name)
|
||||
for scene_index, bldg in self._scene.iterrows():
|
||||
geometry = bldg.geom
|
||||
|
@ -68,7 +66,7 @@ class GPandas:
|
|||
trimesh.repair.fix_winding(building_mesh)
|
||||
year_of_construction = int(bldg['year_built'])
|
||||
name = str(scene_index)
|
||||
|
||||
lod = 1
|
||||
if year_of_construction > 2000:
|
||||
function = cte.RESIDENTIAL
|
||||
else:
|
||||
|
@ -83,7 +81,7 @@ class GPandas:
|
|||
perimeter_polygon = solid_polygon
|
||||
surface = Surface(solid_polygon, perimeter_polygon)
|
||||
surfaces.append(surface)
|
||||
building = Building(name, surfaces, year_of_construction, function, self._lower_corner, terrains=None)
|
||||
building = Building(name, surfaces, year_of_construction, function, terrains=None)
|
||||
self._city.add_city_object(building)
|
||||
self._city.level_of_detail.geometry = lod
|
||||
return self._city
|
||||
|
|
|
@ -6,6 +6,7 @@ Project Coder Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca
|
|||
"""
|
||||
|
||||
import helpers.constants as cte
|
||||
import numpy as np
|
||||
|
||||
|
||||
class GeometryHelper:
|
||||
|
@ -303,3 +304,15 @@ class GeometryHelper:
|
|||
if surface == 'GroundSurface':
|
||||
return 'Ground'
|
||||
return 'Roof'
|
||||
|
||||
@staticmethod
|
||||
def points_from_string(coordinates) -> np.ndarray:
|
||||
points = np.fromstring(coordinates, dtype=float, sep=' ')
|
||||
points = GeometryHelper.to_points_matrix(points)
|
||||
return points
|
||||
|
||||
@staticmethod
|
||||
def remove_last_point_from_string(points):
|
||||
array = points.split(' ')
|
||||
res = " "
|
||||
return res.join(array[0:len(array) - 3])
|
||||
|
|
|
@ -59,11 +59,10 @@ class Obj:
|
|||
self._city = City(self._lower_corner, self._upper_corner, srs_name)
|
||||
scene = self.scene.geometry
|
||||
keys = scene.keys()
|
||||
lod = 1
|
||||
for key in keys:
|
||||
name = key
|
||||
# todo: where do we get this information from?
|
||||
|
||||
lod = 1
|
||||
year_of_construction = 0
|
||||
function = ''
|
||||
|
||||
|
@ -78,7 +77,7 @@ class Obj:
|
|||
perimeter_polygon = solid_polygon
|
||||
surface = Surface(solid_polygon, perimeter_polygon)
|
||||
surfaces.append(surface)
|
||||
building = Building(name, surfaces, year_of_construction, function, self._lower_corner, terrains=None)
|
||||
building = Building(name, surfaces, year_of_construction, function, terrains=None)
|
||||
self._city.add_city_object(building)
|
||||
self._city.level_of_detail.geometry = lod
|
||||
return self._city
|
||||
|
|
|
@ -101,7 +101,7 @@ class Rhino:
|
|||
if face is None:
|
||||
break
|
||||
hub_surfaces = hub_surfaces + self._add_face(face)
|
||||
building = Building(name, hub_surfaces, 'unknown', 'unknown', (self._min_x, self._min_y, self._min_z), [])
|
||||
building = Building(name, hub_surfaces, 'unknown', 'unknown', [])
|
||||
city_objects.append(building)
|
||||
lower_corner = (self._min_x, self._min_y, self._min_z)
|
||||
upper_corner = (self._max_x, self._max_y, self._max_z)
|
||||
|
|
|
@ -5,22 +5,32 @@ Copyright © 2022 Concordia CERC group
|
|||
Project Coder Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
|
||||
"""
|
||||
|
||||
import geopandas
|
||||
from city_model_structure.city import City
|
||||
from imports.geometry.citygml import CityGml
|
||||
from imports.geometry.obj import Obj
|
||||
from imports.geometry.osm_subway import OsmSubway
|
||||
from imports.geometry.rhino import Rhino
|
||||
from imports.geometry.gpandas import GPandas
|
||||
import geopandas
|
||||
from imports.geometry.geojson import Geojson
|
||||
|
||||
|
||||
class GeometryFactory:
|
||||
"""
|
||||
GeometryFactory class
|
||||
"""
|
||||
def __init__(self, file_type, path=None, data_frame=None):
|
||||
def __init__(self, file_type,
|
||||
path=None,
|
||||
data_frame=None,
|
||||
height_field=None,
|
||||
year_of_construction_field=None,
|
||||
function_field=None):
|
||||
self._file_type = '_' + file_type.lower()
|
||||
self._path = path
|
||||
self._data_frame = data_frame
|
||||
self._height_field = height_field
|
||||
self._year_of_construction_field = year_of_construction_field
|
||||
self._function_field = function_field
|
||||
|
||||
@property
|
||||
def _citygml(self) -> City:
|
||||
|
@ -28,7 +38,7 @@ class GeometryFactory:
|
|||
Enrich the city by using CityGML information as data source
|
||||
:return: City
|
||||
"""
|
||||
return CityGml(self._path).city
|
||||
return CityGml(self._path, self._height_field, self._year_of_construction_field, self._function_field).city
|
||||
|
||||
@property
|
||||
def _obj(self) -> City:
|
||||
|
@ -48,6 +58,14 @@ class GeometryFactory:
|
|||
self._data_frame = geopandas.read_file(self._path)
|
||||
return GPandas(self._data_frame).city
|
||||
|
||||
@property
|
||||
def _geojson(self) -> City:
|
||||
"""
|
||||
Enrich the city by using Geojson information as data source
|
||||
:return: City
|
||||
"""
|
||||
return Geojson(self._path, self._height_field, self._year_of_construction_field, self._function_field).city
|
||||
|
||||
@property
|
||||
def _osm_subway(self) -> City:
|
||||
"""
|
||||
|
@ -78,4 +96,4 @@ class GeometryFactory:
|
|||
Enrich the city given to the class using the class given handler
|
||||
:return: City
|
||||
"""
|
||||
return CityGml(self._path).city
|
||||
return Geojson(self._path, self._height_field, self._year_of_construction_field, self._function_field).city
|
||||
|
|
|
@ -193,3 +193,12 @@ class TestConstructionFactory(TestCase):
|
|||
self.assertIsNotNone(thermal_boundary.layers, 'layers is none')
|
||||
self._check_thermal_openings(thermal_boundary)
|
||||
self._check_surfaces(thermal_boundary)
|
||||
|
||||
def test_archetype_not_found(self):
|
||||
file = 'pluto_building.gml'
|
||||
city = self._get_citygml(file)
|
||||
for building in city.buildings:
|
||||
building.year_of_construction = 1990
|
||||
building.function = 'office'
|
||||
ConstructionFactory('nrel', city).enrich()
|
||||
|
||||
|
|
|
@ -48,7 +48,18 @@ class TestEnergySystemsFactory(TestCase):
|
|||
'FuelPrice': 0.12,
|
||||
'FuelEF': 1887,
|
||||
'FuelDensity': 0.717,
|
||||
'HPSupTemp': 60
|
||||
'HPSupTemp': 60,
|
||||
'b1': 10,
|
||||
'b2': 10,
|
||||
'b3': 10,
|
||||
'b4': 10,
|
||||
'b5': 10,
|
||||
'b6': 10,
|
||||
'b7': 10,
|
||||
'b8': 10,
|
||||
'b9': 10,
|
||||
'b10': 10,
|
||||
'b11': 10
|
||||
}
|
||||
|
||||
EnergySystemsExportFactory(self._city, user_input, 'ClimateMaster 156 kW', self._output_path).export('water')
|
||||
|
|
|
@ -9,8 +9,9 @@ from unittest import TestCase
|
|||
|
||||
from numpy import inf
|
||||
|
||||
from imports.geometry_factory import GeometryFactory
|
||||
import exports.exports_factory
|
||||
from imports.construction_factory import ConstructionFactory
|
||||
from imports.geometry_factory import GeometryFactory
|
||||
|
||||
|
||||
class TestGeometryFactory(TestCase):
|
||||
|
@ -25,29 +26,15 @@ class TestGeometryFactory(TestCase):
|
|||
"""
|
||||
self._city = None
|
||||
self._example_path = (Path(__file__).parent / 'tests_data').resolve()
|
||||
self._output_path = (Path(__file__).parent / 'tests_outputs').resolve()
|
||||
|
||||
def _get_citygml(self, file):
|
||||
def _get_city(self, file, file_type, height_field=None, year_of_construction_field=None, function_field=None):
|
||||
file_path = (self._example_path / file).resolve()
|
||||
self._city = GeometryFactory('citygml', path=file_path).city
|
||||
self.assertIsNotNone(self._city, 'city is none')
|
||||
return self._city
|
||||
|
||||
def _get_geojson(self, file):
|
||||
file_path = (self._example_path / file).resolve()
|
||||
self._city = GeometryFactory('gpandas', path=file_path).city
|
||||
self.assertIsNotNone(self._city, 'city is none')
|
||||
return self._city
|
||||
|
||||
def _get_obj(self, file):
|
||||
# todo: solve the incongruities between city and city_debug
|
||||
file_path = (self._example_path / file).resolve()
|
||||
self._city = GeometryFactory('obj', path=file_path).city
|
||||
self.assertIsNotNone(self._city, 'city is none')
|
||||
return self._city
|
||||
|
||||
def _get_rhino(self, file):
|
||||
file_path = (self._example_path / file).resolve()
|
||||
self._city = GeometryFactory('rhino', path=file_path).city
|
||||
self._city = GeometryFactory(file_type,
|
||||
path=file_path,
|
||||
height_field=height_field,
|
||||
year_of_construction_field=year_of_construction_field,
|
||||
function_field=function_field).city
|
||||
self.assertIsNotNone(self._city, 'city is none')
|
||||
return self._city
|
||||
|
||||
|
@ -59,7 +46,6 @@ class TestGeometryFactory(TestCase):
|
|||
self.assertIsNotNone(building.detailed_polyhedron, 'building detailed polyhedron is none')
|
||||
self.assertIsNotNone(building.simplified_polyhedron, 'building simplified polyhedron is none')
|
||||
self.assertIsNotNone(building.surfaces, 'building surfaces is none')
|
||||
self.assertIsNotNone(building.centroid, 'building centroid is none')
|
||||
self.assertIsNotNone(building.max_height, 'building max_height is none')
|
||||
self.assertEqual(len(building.external_temperature), 0, 'building external temperature is calculated')
|
||||
self.assertEqual(len(building.global_horizontal), 0, 'building global horizontal is calculated')
|
||||
|
@ -78,8 +64,6 @@ class TestGeometryFactory(TestCase):
|
|||
self.assertIsNone(building.basement_heated, 'building basement_heated is not none')
|
||||
self.assertIsNone(building.attic_heated, 'building attic_heated is not none')
|
||||
self.assertIsNone(building.terrains, 'building terrains is not none')
|
||||
self.assertIsNotNone(building.year_of_construction, 'building year_of_construction is none')
|
||||
self.assertIsNotNone(building.function, 'building function is none')
|
||||
self.assertIsNone(building.average_storey_height, 'building average_storey_height is not none')
|
||||
self.assertIsNone(building.storeys_above_ground, 'building storeys_above_ground is not none')
|
||||
self.assertEqual(len(building.heating), 0, 'building heating is not none')
|
||||
|
@ -116,8 +100,8 @@ class TestGeometryFactory(TestCase):
|
|||
Test city objects in the city
|
||||
:return: None
|
||||
"""
|
||||
file = 'one_building_in_kelowna.gml'
|
||||
city = self._get_citygml(file)
|
||||
file = 'FZK_Haus_LoD_2.gml'
|
||||
city = self._get_city(file, 'citygml', year_of_construction_field='yearOfConstruction')
|
||||
self.assertTrue(len(city.buildings) == 1)
|
||||
self._check_buildings(city)
|
||||
for building in city.buildings:
|
||||
|
@ -125,13 +109,12 @@ class TestGeometryFactory(TestCase):
|
|||
building.year_of_construction = 2006
|
||||
city = ConstructionFactory('nrel', city).enrich()
|
||||
|
||||
# rhino
|
||||
def test_import_rhino(self):
|
||||
"""
|
||||
Test rhino import
|
||||
"""
|
||||
file = 'dompark.3dm'
|
||||
city = self._get_rhino(file)
|
||||
city = self._get_city(file, 'rhino')
|
||||
self.assertIsNotNone(city, 'city is none')
|
||||
self.assertTrue(len(city.buildings) == 36)
|
||||
i = 0
|
||||
|
@ -139,14 +122,12 @@ class TestGeometryFactory(TestCase):
|
|||
self.assertIsNot(building.volume, inf, 'open volume')
|
||||
i += 1
|
||||
|
||||
# obj
|
||||
def test_import_obj(self):
|
||||
"""
|
||||
Test obj import
|
||||
"""
|
||||
file = 'kelowna.obj'
|
||||
city = self._get_obj(file)
|
||||
self.assertIsNotNone(city, 'city is none')
|
||||
city = self._get_city(file, 'obj')
|
||||
self.assertTrue(len(city.buildings) == 1)
|
||||
self._check_buildings(city)
|
||||
for building in city.buildings:
|
||||
|
@ -157,12 +138,24 @@ class TestGeometryFactory(TestCase):
|
|||
Test geopandas import
|
||||
"""
|
||||
file = 'sample.geojson'
|
||||
city = self._get_geojson(file)
|
||||
self.assertIsNotNone(city, 'city is none')
|
||||
city = self._get_city(file, 'gpandas')
|
||||
self.assertTrue(len(city.buildings) == 1)
|
||||
self._check_buildings(city)
|
||||
|
||||
for building in city.buildings:
|
||||
self._check_surfaces(building)
|
||||
self.assertEqual(1912.0898135701814, building.volume)
|
||||
self.assertEqual(146.19493345171213, building.floor_area)
|
||||
|
||||
def test_import_geojson(self):
|
||||
"""
|
||||
Test geojson import
|
||||
"""
|
||||
file = 'sample.geojson'
|
||||
city = self._get_city(file, 'geojson',
|
||||
height_field='citygml_me',
|
||||
year_of_construction_field='ANNEE_CONS',
|
||||
function_field='LIBELLE_UT')
|
||||
|
||||
exports.exports_factory.ExportsFactory('obj', city, self._output_path).export_debug()
|
||||
self.assertEqual(207, len(city.buildings), 'wrong number of buildings')
|
||||
self._check_buildings(city)
|
||||
|
|
191088
unittests/tests_data/FZK-Haus-LoD4-KIT-IAI-KHH-B36-V1.gml
Normal file
191088
unittests/tests_data/FZK-Haus-LoD4-KIT-IAI-KHH-B36-V1.gml
Normal file
File diff suppressed because it is too large
Load Diff
80
unittests/tests_data/FZK_Haus_LoD_0.gml
Normal file
80
unittests/tests_data/FZK_Haus_LoD_0.gml
Normal file
|
@ -0,0 +1,80 @@
|
|||
<?xml version="1.0" encoding="utf-8"?><!-- Generated by: --><!-- IFC -> cityGML Converter --><!-- (C) - Institute for Applied Computer Science --><!-- Forschungszentrum Karlsruhe --><!-- Not for commercial use --><!-- Generated by: IfcExplorer--><!-- cityGML Schema: 1.0.0 --><!-- Level of Detail 1--><!-- Creation Date: Tuesday, 23 November 2010 - 10:37:59--><!-- Edited Manually in Oxygen 8.2 --><!-- Modified by GMLOffset.xslt at Mon Dec 6 2010 --><!-- Version 2 Building located in the area of KIT Campus North)--><!-- Modified by GMLOffset.xslt at Wed Dec 8 2010 --><!-- Modified by GMLOffset.xslt at Wed Mar 29 2017 --><core:CityModel xsi:schemaLocation="http://www.opengis.net/citygml/2.0 http://schemas.opengis.net/citygml/2.0/cityGMLBase.xsd http://www.opengis.net/citygml/appearance/2.0 http://schemas.opengis.net/citygml/appearance/2.0/appearance.xsd http://www.opengis.net/citygml/building/2.0 http://schemas.opengis.net/citygml/building/2.0/building.xsd http://www.opengis.net/citygml/generics/2.0 http://schemas.opengis.net/citygml/generics/2.0/generics.xsd" xmlns:core="http://www.opengis.net/citygml/2.0" xmlns="http://www.opengis.net/citygml/profiles/base/2.0" xmlns:bldg="http://www.opengis.net/citygml/building/2.0" xmlns:gen="http://www.opengis.net/citygml/generics/2.0" xmlns:grp="http://www.opengis.net/citygml/cityobjectgroup/2.0" xmlns:app="http://www.opengis.net/citygml/appearance/2.0" xmlns:gml="http://www.opengis.net/gml" xmlns:xAL="urn:oasis:names:tc:ciq:xsdschema:xAL:2.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<!-- Manually edited by KHH 23.01.2017, Address added, roof edge added -->
|
||||
<gml:name>AC14-FZK-Haus</gml:name>
|
||||
<gml:boundedBy>
|
||||
<gml:Envelope srsDimension="3" srsName="urn:adv:crs:ETRS89_UTM32*DE_DHHN92_NH">
|
||||
<gml:lowerCorner srsDimension="3">457842 5439083 111.8 </gml:lowerCorner>
|
||||
<gml:upperCorner srsDimension="3">457854 5439093 118.317669 </gml:upperCorner>
|
||||
</gml:Envelope>
|
||||
</gml:boundedBy>
|
||||
<core:cityObjectMember>
|
||||
<bldg:Building gml:id="UUID_d281adfc-4901-0f52-540b-4cc1a9325f82">
|
||||
<gml:description>FZK-Haus (Forschungszentrum Karlsruhe, now KIT), created by Karl-Heinz
|
||||
Haefele </gml:description>
|
||||
<gml:name>AC14-FZK-Haus</gml:name>
|
||||
<core:creationDate>2017-01-23</core:creationDate>
|
||||
<core:relativeToTerrain>entirelyAboveTerrain</core:relativeToTerrain>
|
||||
<gen:measureAttribute name="GrossPlannedArea">
|
||||
<gen:value uom="m2">120.00</gen:value>
|
||||
</gen:measureAttribute>
|
||||
<gen:stringAttribute name="ConstructionMethod">
|
||||
<gen:value>New Building</gen:value>
|
||||
</gen:stringAttribute>
|
||||
<gen:stringAttribute name="IsLandmarked">
|
||||
<gen:value>NO</gen:value>
|
||||
</gen:stringAttribute>
|
||||
<bldg:class codeSpace="http://www.sig3d.org/codelists/citygml/2.0/building/2.0/_AbstractBuilding_class.xml">1000</bldg:class>
|
||||
<bldg:function codeSpace="http://www.sig3d.org/codelists/citygml/2.0/building/2.0/_AbstractBuilding_function.xml">1000</bldg:function>
|
||||
<bldg:usage codeSpace="http://www.sig3d.org/codelists/citygml/2.0/building/2.0/_AbstractBuilding_usage.xml">1000</bldg:usage>
|
||||
<bldg:yearOfConstruction>2020</bldg:yearOfConstruction>
|
||||
<bldg:roofType codeSpace="http://www.sig3d.org/codelists/citygml/2.0/building/2.0/_AbstractBuilding_roofType.xml">1030</bldg:roofType>
|
||||
<bldg:measuredHeight uom="m">6.52</bldg:measuredHeight>
|
||||
<bldg:storeysAboveGround>2</bldg:storeysAboveGround>
|
||||
<bldg:storeysBelowGround>0</bldg:storeysBelowGround>
|
||||
<bldg:lod0FootPrint>
|
||||
<gml:MultiSurface>
|
||||
<gml:surfaceMember>
|
||||
<gml:Polygon>
|
||||
<gml:exterior>
|
||||
<gml:LinearRing>
|
||||
<gml:posList srsDimension="3">457842 5439083 111.8 457842 5439093 111.8 457854 5439093 111.8 457854 5439083 111.8 457842 5439083 111.8 </gml:posList>
|
||||
</gml:LinearRing>
|
||||
</gml:exterior>
|
||||
</gml:Polygon>
|
||||
</gml:surfaceMember>
|
||||
</gml:MultiSurface>
|
||||
</bldg:lod0FootPrint>
|
||||
<bldg:lod0RoofEdge>
|
||||
<gml:MultiSurface>
|
||||
<gml:surfaceMember>
|
||||
<gml:Polygon>
|
||||
<gml:exterior>
|
||||
<gml:LinearRing>
|
||||
<gml:posList srsDimension="3">457841.5 5439082.5 111.8 457841.5 5439093.5 111.8 457854.5 5439093.5 111.8 457854.5 5439082.5 111.8 457841.5 5439082.5 111.8 </gml:posList>
|
||||
</gml:LinearRing>
|
||||
</gml:exterior>
|
||||
</gml:Polygon>
|
||||
</gml:surfaceMember>
|
||||
</gml:MultiSurface>
|
||||
</bldg:lod0RoofEdge>
|
||||
<bldg:address>
|
||||
<core:Address>
|
||||
<core:xalAddress>
|
||||
<xAL:AddressDetails>
|
||||
<xAL:Locality Type="Town">
|
||||
<xAL:LocalityName>Eggenstein-Leopoldshafen</xAL:LocalityName>
|
||||
<xAL:Thoroughfare Type="Street">
|
||||
<xAL:ThoroughfareNumber>4711</xAL:ThoroughfareNumber>
|
||||
<xAL:ThoroughfareName>Spöcker Straße</xAL:ThoroughfareName>
|
||||
</xAL:Thoroughfare>
|
||||
<xAL:PostalCode>
|
||||
<xAL:PostalCodeNumber>76344</xAL:PostalCodeNumber>
|
||||
</xAL:PostalCode>
|
||||
</xAL:Locality>
|
||||
</xAL:AddressDetails>
|
||||
</core:xalAddress>
|
||||
</core:Address>
|
||||
</bldg:address>
|
||||
</bldg:Building>
|
||||
</core:cityObjectMember>
|
||||
</core:CityModel>
|
116
unittests/tests_data/FZK_Haus_LoD_1.gml
Normal file
116
unittests/tests_data/FZK_Haus_LoD_1.gml
Normal file
|
@ -0,0 +1,116 @@
|
|||
<?xml version="1.0" encoding="utf-8"?><!-- Generated by: --><!-- IFC -> cityGML Converter --><!-- (C) - Institute for Applied Computer Science --><!-- Forschungszentrum Karlsruhe --><!-- Not for commercial use --><!-- Generated by: IfcExplorer--><!-- cityGML Schema: 1.0.0 --><!-- Level of Detail 1--><!-- Creation Date: Tuesday, 23 November 2010 - 10:37:59--><!-- Edited Manually in Oxygen 8.2 --><!-- Modified by GMLOffset.xslt at Mon Dec 6 2010 --><!-- Version 2 Building located in the area of KIT Campus North)--><!-- Modified by GMLOffset.xslt at Wed Dec 8 2010 --><!-- Modified by GMLOffset.xslt at Wed Mar 29 2017 --><core:CityModel xsi:schemaLocation="http://www.opengis.net/citygml/2.0 http://schemas.opengis.net/citygml/2.0/cityGMLBase.xsd http://www.opengis.net/citygml/appearance/2.0 http://schemas.opengis.net/citygml/appearance/2.0/appearance.xsd http://www.opengis.net/citygml/building/2.0 http://schemas.opengis.net/citygml/building/2.0/building.xsd http://www.opengis.net/citygml/generics/2.0 http://schemas.opengis.net/citygml/generics/2.0/generics.xsd" xmlns:core="http://www.opengis.net/citygml/2.0" xmlns="http://www.opengis.net/citygml/profiles/base/2.0" xmlns:bldg="http://www.opengis.net/citygml/building/2.0" xmlns:gen="http://www.opengis.net/citygml/generics/2.0" xmlns:grp="http://www.opengis.net/citygml/cityobjectgroup/2.0" xmlns:app="http://www.opengis.net/citygml/appearance/2.0" xmlns:gml="http://www.opengis.net/gml" xmlns:xAL="urn:oasis:names:tc:ciq:xsdschema:xAL:2.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<!-- Manually edited by KHH 23.01.2017, CityGML 2.0, Address added, roof edge added -->
|
||||
<gml:name>AC14-FZK-Haus</gml:name>
|
||||
<gml:boundedBy>
|
||||
<gml:Envelope srsDimension="3" srsName="urn:adv:crs:ETRS89_UTM32*DE_DHHN92_NH">
|
||||
<gml:lowerCorner srsDimension="3">457842 5439083 111.8 </gml:lowerCorner>
|
||||
<gml:upperCorner srsDimension="3">457854 5439093 118.317669 </gml:upperCorner>
|
||||
</gml:Envelope>
|
||||
</gml:boundedBy>
|
||||
<core:cityObjectMember>
|
||||
<bldg:Building gml:id="UUID_d281adfc-4901-0f52-540b-4cc1a9325f82">
|
||||
<gml:description>FZK-Haus (Forschungszentrum Karlsruhe, now KIT), created by Karl-Heinz
|
||||
Haefele </gml:description>
|
||||
<gml:name>AC14-FZK-Haus</gml:name>
|
||||
<core:creationDate>2017-01-23</core:creationDate>
|
||||
<core:relativeToTerrain>entirelyAboveTerrain</core:relativeToTerrain>
|
||||
<gen:measureAttribute name="GrossPlannedArea">
|
||||
<gen:value uom="m2">120.00</gen:value>
|
||||
</gen:measureAttribute>
|
||||
<gen:stringAttribute name="ConstructionMethod">
|
||||
<gen:value>New Building</gen:value>
|
||||
</gen:stringAttribute>
|
||||
<gen:stringAttribute name="IsLandmarked">
|
||||
<gen:value>NO</gen:value>
|
||||
</gen:stringAttribute>
|
||||
<bldg:class codeSpace="http://www.sig3d.org/codelists/citygml/2.0/building/2.0/_AbstractBuilding_class.xml">1000</bldg:class>
|
||||
<bldg:function codeSpace="http://www.sig3d.org/codelists/citygml/2.0/building/2.0/_AbstractBuilding_function.xml">1000</bldg:function>
|
||||
<bldg:usage codeSpace="http://www.sig3d.org/codelists/citygml/2.0/building/2.0/_AbstractBuilding_usage.xml">1000</bldg:usage>
|
||||
<bldg:yearOfConstruction>2020</bldg:yearOfConstruction>
|
||||
<bldg:roofType codeSpace="http://www.sig3d.org/codelists/citygml/2.0/building/2.0/_AbstractBuilding_roofType.xml">1030</bldg:roofType>
|
||||
<bldg:measuredHeight uom="m">6.52</bldg:measuredHeight>
|
||||
<bldg:storeysAboveGround>2</bldg:storeysAboveGround>
|
||||
<bldg:storeysBelowGround>0</bldg:storeysBelowGround>
|
||||
<bldg:lod1Solid>
|
||||
<gml:Solid>
|
||||
<gml:exterior>
|
||||
<gml:CompositeSurface>
|
||||
<gml:surfaceMember>
|
||||
<gml:Polygon>
|
||||
<gml:exterior>
|
||||
<gml:LinearRing>
|
||||
<gml:posList srsDimension="3">457842 5439083 111.8 457842 5439093 111.8 457854 5439093 111.8 457854 5439083 111.8 457842 5439083 111.8 </gml:posList>
|
||||
</gml:LinearRing>
|
||||
</gml:exterior>
|
||||
</gml:Polygon>
|
||||
</gml:surfaceMember>
|
||||
<gml:surfaceMember>
|
||||
<gml:Polygon>
|
||||
<gml:exterior>
|
||||
<gml:LinearRing>
|
||||
<gml:posList srsDimension="3">457842 5439083 118.31769 457854 5439083 118.31769 457854 5439093 118.31769 457842 5439093 118.31769 457842 5439083 118.31769 </gml:posList>
|
||||
</gml:LinearRing>
|
||||
</gml:exterior>
|
||||
</gml:Polygon>
|
||||
</gml:surfaceMember>
|
||||
<gml:surfaceMember>
|
||||
<gml:Polygon>
|
||||
<gml:exterior>
|
||||
<gml:LinearRing>
|
||||
<gml:posList srsDimension="3">457842 5439083 111.8 457842 5439083 118.31769 457842 5439093 118.31769 457842 5439093 111.8 457842 5439083 111.8 </gml:posList>
|
||||
</gml:LinearRing>
|
||||
</gml:exterior>
|
||||
</gml:Polygon>
|
||||
</gml:surfaceMember>
|
||||
<gml:surfaceMember>
|
||||
<gml:Polygon>
|
||||
<gml:exterior>
|
||||
<gml:LinearRing>
|
||||
<gml:posList srsDimension="3">457842 5439093 111.8 457842 5439093 118.31769 457854 5439093 118.31769 457854 5439093 111.8 457842 5439093 111.8 </gml:posList>
|
||||
</gml:LinearRing>
|
||||
</gml:exterior>
|
||||
</gml:Polygon>
|
||||
</gml:surfaceMember>
|
||||
<gml:surfaceMember>
|
||||
<gml:Polygon>
|
||||
<gml:exterior>
|
||||
<gml:LinearRing>
|
||||
<gml:posList srsDimension="3">457854 5439093 111.8 457854 5439093 118.31769 457854 5439083 118.31769 457854 5439083 111.8 457854 5439093 111.8 </gml:posList>
|
||||
</gml:LinearRing>
|
||||
</gml:exterior>
|
||||
</gml:Polygon>
|
||||
</gml:surfaceMember>
|
||||
<gml:surfaceMember>
|
||||
<gml:Polygon>
|
||||
<gml:exterior>
|
||||
<gml:LinearRing>
|
||||
<gml:posList srsDimension="3">457854 5439083 111.8 457854 5439083 118.31769 457842 5439083 118.31769 457842 5439083 111.8 457854 5439083 111.8 </gml:posList>
|
||||
</gml:LinearRing>
|
||||
</gml:exterior>
|
||||
</gml:Polygon>
|
||||
</gml:surfaceMember>
|
||||
</gml:CompositeSurface>
|
||||
</gml:exterior>
|
||||
</gml:Solid>
|
||||
</bldg:lod1Solid>
|
||||
<bldg:address>
|
||||
<core:Address>
|
||||
<core:xalAddress>
|
||||
<xAL:AddressDetails>
|
||||
<xAL:Locality Type="Town">
|
||||
<xAL:LocalityName>Eggenstein-Leopoldshafen</xAL:LocalityName>
|
||||
<xAL:Thoroughfare Type="Street">
|
||||
<xAL:ThoroughfareNumber>4711</xAL:ThoroughfareNumber>
|
||||
<xAL:ThoroughfareName>Spöcker Straße</xAL:ThoroughfareName>
|
||||
</xAL:Thoroughfare>
|
||||
<xAL:PostalCode>
|
||||
<xAL:PostalCodeNumber>76344</xAL:PostalCodeNumber>
|
||||
</xAL:PostalCode>
|
||||
</xAL:Locality>
|
||||
</xAL:AddressDetails>
|
||||
</core:xalAddress>
|
||||
</core:Address>
|
||||
</bldg:address>
|
||||
</bldg:Building>
|
||||
</core:cityObjectMember>
|
||||
</core:CityModel>
|
240
unittests/tests_data/FZK_Haus_LoD_2.gml
Normal file
240
unittests/tests_data/FZK_Haus_LoD_2.gml
Normal file
|
@ -0,0 +1,240 @@
|
|||
<?xml version="1.0" encoding="utf-8"?><!-- IFC to CityGML by IFCExplorer KIT --><!-- CityGML to Sketchup by Sketchup CityGML Plugin FH GelsenKirchen --><!--CityGML Dataset produced with CityGML Export Plugin for Sketchup by GeoRES --><!--http://www.geores.de --><!-- Edited Manually in Oxygen 8.2 --><!-- Modified by GMLOffset.xslt at Mon Dec 6 2010 --><!-- Version 2 Building located in the area of KIT Campus North)--><!-- Modified by GMLOffset.xslt at Wed Dec 8 2010 --><!-- Modified by GMLOffset.xslt at Wed Mar 29 2017 --><core:CityModel xsi:schemaLocation="http://www.opengis.net/citygml/2.0 http://schemas.opengis.net/citygml/2.0/cityGMLBase.xsd http://www.opengis.net/citygml/appearance/2.0 http://schemas.opengis.net/citygml/appearance/2.0/appearance.xsd http://www.opengis.net/citygml/building/2.0 http://schemas.opengis.net/citygml/building/2.0/building.xsd http://www.opengis.net/citygml/generics/2.0 http://schemas.opengis.net/citygml/generics/2.0/generics.xsd" xmlns:core="http://www.opengis.net/citygml/2.0" xmlns="http://www.opengis.net/citygml/profiles/base/2.0" xmlns:bldg="http://www.opengis.net/citygml/building/2.0" xmlns:gen="http://www.opengis.net/citygml/generics/2.0" xmlns:grp="http://www.opengis.net/citygml/cityobjectgroup/2.0" xmlns:app="http://www.opengis.net/citygml/appearance/2.0" xmlns:gml="http://www.opengis.net/gml" xmlns:xAL="urn:oasis:names:tc:ciq:xsdschema:xAL:2.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<!-- Manually edited by KHH 23.01.2017, CityGML 2.0, Address added, Codespaces added -->
|
||||
<gml:name>AC14-FZK-Haus</gml:name>
|
||||
<gml:boundedBy>
|
||||
<gml:Envelope srsDimension="3" srsName="urn:adv:crs:ETRS89_UTM32*DE_DHHN92_NH">
|
||||
<gml:lowerCorner srsDimension="3">457842 5439083 111.8 </gml:lowerCorner>
|
||||
<gml:upperCorner srsDimension="3">457854 5439093 118.317669 </gml:upperCorner>
|
||||
</gml:Envelope>
|
||||
</gml:boundedBy>
|
||||
<core:cityObjectMember>
|
||||
<bldg:Building gml:id="UUID_d281adfc-4901-0f52-540b-4cc1a9325f82">
|
||||
<gml:description>FZK-Haus (Forschungszentrum Karlsruhe, now KIT), created by Karl-Heinz
|
||||
Haefele </gml:description>
|
||||
<gml:name>AC14-FZK-Haus</gml:name>
|
||||
<core:creationDate>2017-01-23</core:creationDate>
|
||||
<core:relativeToTerrain>entirelyAboveTerrain</core:relativeToTerrain>
|
||||
<gen:measureAttribute name="GrossPlannedArea">
|
||||
<gen:value uom="m2">120.00</gen:value>
|
||||
</gen:measureAttribute>
|
||||
<gen:stringAttribute name="ConstructionMethod">
|
||||
<gen:value>New Building</gen:value>
|
||||
</gen:stringAttribute>
|
||||
<gen:stringAttribute name="IsLandmarked">
|
||||
<gen:value>NO</gen:value>
|
||||
</gen:stringAttribute>
|
||||
<bldg:class codeSpace="http://www.sig3d.org/codelists/citygml/2.0/building/2.0/_AbstractBuilding_class.xml">1000</bldg:class>
|
||||
<bldg:function codeSpace="http://www.sig3d.org/codelists/citygml/2.0/building/2.0/_AbstractBuilding_function.xml">1000</bldg:function>
|
||||
<bldg:usage codeSpace="http://www.sig3d.org/codelists/citygml/2.0/building/2.0/_AbstractBuilding_usage.xml">1000</bldg:usage>
|
||||
<bldg:yearOfConstruction>2020</bldg:yearOfConstruction>
|
||||
<bldg:roofType codeSpace="http://www.sig3d.org/codelists/citygml/2.0/building/2.0/_AbstractBuilding_roofType.xml">1030</bldg:roofType>
|
||||
<bldg:measuredHeight uom="m">6.52</bldg:measuredHeight>
|
||||
<bldg:storeysAboveGround>2</bldg:storeysAboveGround>
|
||||
<bldg:storeysBelowGround>0</bldg:storeysBelowGround>
|
||||
<bldg:lod2Solid>
|
||||
<gml:Solid>
|
||||
<gml:exterior>
|
||||
<gml:CompositeSurface>
|
||||
<!--Outer Wall 1 (West) -->
|
||||
<gml:surfaceMember xlink:href="#PolyID7350_878_759628_120742"> </gml:surfaceMember>
|
||||
<!--Outer Wall 1 (West) -->
|
||||
<!--Outer Wall 2 (South) -->
|
||||
<gml:surfaceMember xlink:href="#PolyID7351_1722_416019_316876" />
|
||||
<!--Outer Wall 2 (South) -->
|
||||
<!--Outer Wall 3 (East) -->
|
||||
<gml:surfaceMember xlink:href="#PolyID7352_230_209861_355851" />
|
||||
<!--Outer Wall 3 (East) -->
|
||||
<!--Roof 1 (North) -->
|
||||
<gml:surfaceMember xlink:href="#PolyID7353_166_774155_320806" />
|
||||
<!--Roof 1 (North) -->
|
||||
<!--Outer Wall 4 (North) -->
|
||||
<gml:surfaceMember xlink:href="#PolyID7354_1362_450904_410226" />
|
||||
<!--Outer Wall 2 (North) -->
|
||||
<!--Roof 2 (South) -->
|
||||
<gml:surfaceMember xlink:href="#PolyID7355_537_416207_260034" />
|
||||
<!--Roof 2 (South) -->
|
||||
<!--Base Surface -->
|
||||
<gml:surfaceMember xlink:href="#PolyID7356_612_880782_415367" />
|
||||
<!--Base Surface -->
|
||||
</gml:CompositeSurface>
|
||||
</gml:exterior>
|
||||
</gml:Solid>
|
||||
</bldg:lod2Solid>
|
||||
<bldg:boundedBy>
|
||||
<bldg:WallSurface gml:id="GML_5856d7ad-5e34-498a-817b-9544bfbb1475">
|
||||
<gml:name>Outer Wall 1 (West)</gml:name>
|
||||
<bldg:lod2MultiSurface>
|
||||
<gml:MultiSurface>
|
||||
<gml:surfaceMember>
|
||||
<gml:Polygon gml:id="PolyID7350_878_759628_120742">
|
||||
<gml:exterior>
|
||||
<gml:LinearRing gml:id="PolyID7350_878_759628_120742_0">
|
||||
<gml:pos>457842 5439088 118.317691453624 </gml:pos>
|
||||
<gml:pos>457842 5439093 115.430940107676 </gml:pos>
|
||||
<gml:pos>457842 5439093 111.8 </gml:pos>
|
||||
<gml:pos>457842 5439083 111.8 </gml:pos>
|
||||
<gml:pos>457842 5439083 115.430940107676 </gml:pos>
|
||||
<gml:pos>457842 5439088 118.317691453624 </gml:pos>
|
||||
</gml:LinearRing>
|
||||
</gml:exterior>
|
||||
</gml:Polygon>
|
||||
</gml:surfaceMember>
|
||||
</gml:MultiSurface>
|
||||
</bldg:lod2MultiSurface>
|
||||
</bldg:WallSurface>
|
||||
</bldg:boundedBy>
|
||||
<bldg:boundedBy>
|
||||
<bldg:WallSurface gml:id="GML_d38cf762-c29d-4491-88c9-bdc89e141978">
|
||||
<gml:name>Outer Wall 2 (South)</gml:name>
|
||||
<bldg:lod2MultiSurface>
|
||||
<gml:MultiSurface>
|
||||
<gml:surfaceMember>
|
||||
<gml:Polygon gml:id="PolyID7351_1722_416019_316876">
|
||||
<gml:exterior>
|
||||
<gml:LinearRing gml:id="PolyID7351_1722_416019_316876_0">
|
||||
<gml:pos>457854 5439083 115.430940107676 </gml:pos>
|
||||
<gml:pos>457842 5439083 115.430940107676 </gml:pos>
|
||||
<gml:pos>457842 5439083 111.8 </gml:pos>
|
||||
<gml:pos>457854 5439083 111.8 </gml:pos>
|
||||
<gml:pos>457854 5439083 115.430940107676 </gml:pos>
|
||||
</gml:LinearRing>
|
||||
</gml:exterior>
|
||||
</gml:Polygon>
|
||||
</gml:surfaceMember>
|
||||
</gml:MultiSurface>
|
||||
</bldg:lod2MultiSurface>
|
||||
</bldg:WallSurface>
|
||||
</bldg:boundedBy>
|
||||
<bldg:boundedBy>
|
||||
<bldg:WallSurface gml:id="GML_8e5db638-e46a-4739-a98a-2fc2d39c9069">
|
||||
<gml:name>Outer Wall 3 (East)</gml:name>
|
||||
<bldg:lod2MultiSurface>
|
||||
<gml:MultiSurface>
|
||||
<gml:surfaceMember>
|
||||
<gml:Polygon gml:id="PolyID7352_230_209861_355851">
|
||||
<gml:exterior>
|
||||
<gml:LinearRing gml:id="PolyID7352_230_209861_355851_0">
|
||||
<gml:pos>457854 5439088 118.317691453624 </gml:pos>
|
||||
<gml:pos>457854 5439083 115.430940107676 </gml:pos>
|
||||
<gml:pos>457854 5439083 111.8 </gml:pos>
|
||||
<gml:pos>457854 5439093 111.8 </gml:pos>
|
||||
<gml:pos>457854 5439093 115.430940107676 </gml:pos>
|
||||
<gml:pos>457854 5439088 118.317691453624 </gml:pos>
|
||||
</gml:LinearRing>
|
||||
</gml:exterior>
|
||||
</gml:Polygon>
|
||||
</gml:surfaceMember>
|
||||
</gml:MultiSurface>
|
||||
</bldg:lod2MultiSurface>
|
||||
</bldg:WallSurface>
|
||||
</bldg:boundedBy>
|
||||
<bldg:boundedBy>
|
||||
<bldg:RoofSurface gml:id="GML_875d470b-32b4-4985-a4c8-0f02caa342a2">
|
||||
<gml:name>Roof 1 (North)</gml:name>
|
||||
<bldg:lod2MultiSurface>
|
||||
<gml:MultiSurface>
|
||||
<gml:surfaceMember>
|
||||
<gml:Polygon gml:id="PolyID7353_166_774155_320806">
|
||||
<gml:exterior>
|
||||
<gml:LinearRing gml:id="PolyID7353_166_774155_320806_0">
|
||||
<gml:pos>457842 5439088 118.317691453624 </gml:pos>
|
||||
<gml:pos>457854 5439088 118.317691453624 </gml:pos>
|
||||
<gml:pos>457854 5439093 115.430940107676 </gml:pos>
|
||||
<gml:pos>457842 5439093 115.430940107676 </gml:pos>
|
||||
<gml:pos>457842 5439088 118.317691453624 </gml:pos>
|
||||
</gml:LinearRing>
|
||||
</gml:exterior>
|
||||
</gml:Polygon>
|
||||
</gml:surfaceMember>
|
||||
</gml:MultiSurface>
|
||||
</bldg:lod2MultiSurface>
|
||||
</bldg:RoofSurface>
|
||||
</bldg:boundedBy>
|
||||
<bldg:boundedBy>
|
||||
<bldg:WallSurface gml:id="GML_0f30f604-e70d-4dfe-ba35-853bc69609cc">
|
||||
<gml:name>Outer Wall 4 (North)</gml:name>
|
||||
<bldg:lod2MultiSurface>
|
||||
<gml:MultiSurface>
|
||||
<gml:surfaceMember>
|
||||
<gml:Polygon gml:id="PolyID7354_1362_450904_410226">
|
||||
<gml:exterior>
|
||||
<gml:LinearRing gml:id="PolyID7354_1362_450904_410226_0">
|
||||
<gml:pos>457842 5439093 115.430940107676 </gml:pos>
|
||||
<gml:pos>457854 5439093 115.430940107676 </gml:pos>
|
||||
<gml:pos>457854 5439093 111.8 </gml:pos>
|
||||
<gml:pos>457842 5439093 111.8 </gml:pos>
|
||||
<gml:pos>457842 5439093 115.430940107676 </gml:pos>
|
||||
</gml:LinearRing>
|
||||
</gml:exterior>
|
||||
</gml:Polygon>
|
||||
</gml:surfaceMember>
|
||||
</gml:MultiSurface>
|
||||
</bldg:lod2MultiSurface>
|
||||
</bldg:WallSurface>
|
||||
</bldg:boundedBy>
|
||||
<bldg:boundedBy>
|
||||
<bldg:RoofSurface gml:id="GML_eeb6796a-e261-4d3b-a6f2-475940cca80a">
|
||||
<gml:name>Roof 2 (South)</gml:name>
|
||||
<bldg:lod2MultiSurface>
|
||||
<gml:MultiSurface>
|
||||
<gml:surfaceMember>
|
||||
<gml:Polygon gml:id="PolyID7355_537_416207_260034">
|
||||
<gml:exterior>
|
||||
<gml:LinearRing gml:id="PolyID7355_537_416207_260034_0">
|
||||
<gml:pos>457854 5439083 115.430940107676 </gml:pos>
|
||||
<gml:pos>457854 5439088 118.317691453624 </gml:pos>
|
||||
<gml:pos>457842 5439088 118.317691453624 </gml:pos>
|
||||
<gml:pos>457842 5439083 115.430940107676 </gml:pos>
|
||||
<gml:pos>457854 5439083 115.430940107676 </gml:pos>
|
||||
</gml:LinearRing>
|
||||
</gml:exterior>
|
||||
</gml:Polygon>
|
||||
</gml:surfaceMember>
|
||||
</gml:MultiSurface>
|
||||
</bldg:lod2MultiSurface>
|
||||
</bldg:RoofSurface>
|
||||
</bldg:boundedBy>
|
||||
<bldg:boundedBy>
|
||||
<bldg:GroundSurface gml:id="GML_257a8dde-8194-4ca3-b581-abd591dcd6a3">
|
||||
<gml:description>Bodenplatte</gml:description>
|
||||
<gml:name>Base Surface</gml:name>
|
||||
<bldg:lod2MultiSurface>
|
||||
<gml:MultiSurface>
|
||||
<gml:surfaceMember>
|
||||
<gml:Polygon gml:id="PolyID7356_612_880782_415367">
|
||||
<gml:exterior>
|
||||
<gml:LinearRing gml:id="PolyID7356_612_880782_415367_0">
|
||||
<gml:pos>457854 5439083 111.8 </gml:pos>
|
||||
<gml:pos>457842 5439083 111.8 </gml:pos>
|
||||
<gml:pos>457842 5439093 111.8 </gml:pos>
|
||||
<gml:pos>457854 5439093 111.8 </gml:pos>
|
||||
<gml:pos>457854 5439083 111.8 </gml:pos>
|
||||
</gml:LinearRing>
|
||||
</gml:exterior>
|
||||
</gml:Polygon>
|
||||
</gml:surfaceMember>
|
||||
</gml:MultiSurface>
|
||||
</bldg:lod2MultiSurface>
|
||||
</bldg:GroundSurface>
|
||||
</bldg:boundedBy>
|
||||
<bldg:address>
|
||||
<core:Address>
|
||||
<core:xalAddress>
|
||||
<xAL:AddressDetails>
|
||||
<xAL:Locality Type="Town">
|
||||
<xAL:LocalityName>Eggenstein-Leopoldshafen</xAL:LocalityName>
|
||||
<xAL:Thoroughfare Type="Street">
|
||||
<xAL:ThoroughfareNumber>4711</xAL:ThoroughfareNumber>
|
||||
<xAL:ThoroughfareName>Spöcker Straße</xAL:ThoroughfareName>
|
||||
</xAL:Thoroughfare>
|
||||
<xAL:PostalCode>
|
||||
<xAL:PostalCodeNumber>76344</xAL:PostalCodeNumber>
|
||||
</xAL:PostalCode>
|
||||
</xAL:Locality>
|
||||
</xAL:AddressDetails>
|
||||
</core:xalAddress>
|
||||
</core:Address>
|
||||
</bldg:address>
|
||||
</bldg:Building>
|
||||
</core:cityObjectMember>
|
||||
</core:CityModel>
|
3451
unittests/tests_data/FZK_Haus_LoD_3.gml
Normal file
3451
unittests/tests_data/FZK_Haus_LoD_3.gml
Normal file
File diff suppressed because it is too large
Load Diff
52243
unittests/tests_data/concordia.geojson
Normal file
52243
unittests/tests_data/concordia.geojson
Normal file
File diff suppressed because it is too large
Load Diff
1408
unittests/tests_data/custom.geojson
Normal file
1408
unittests/tests_data/custom.geojson
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user