Hadise Rasoulian
34e2d598b9
In level 1, the two following files are added: 1. FZK-Haus-LoD2-KIT-IAI-KHH-B36-V1.gml: A geometry file used to create the city (input). 2. main_level1.py: The main code to assign archetypes to buildings based on their function and construction year.
34 lines
1.1 KiB
Python
34 lines
1.1 KiB
Python
from hub.imports.geometry_factory import GeometryFactory
|
|
from hub.imports.construction_factory import ConstructionFactory
|
|
from hub.helpers.dictionaries import Dictionaries
|
|
from hub.exports.exports_factory import ExportsFactory
|
|
|
|
|
|
# Level0:
|
|
gml_file = './FZK-Haus-LoD2-KIT-IAI-KHH-B36-V1.gml'
|
|
city = GeometryFactory('citygml', gml_file, function_to_hub=Dictionaries().montreal_function_to_hub_function).city
|
|
|
|
for building in city.buildings:
|
|
print(building.name)
|
|
print(building.volume)
|
|
print(building.floor_area)
|
|
|
|
|
|
# Level1:
|
|
city1 = city.copy
|
|
|
|
for building in city1.buildings:
|
|
print ("Construction year of building in city1 is: ", building.year_of_construction)
|
|
print ("Building's function in city1 is: " , building.function)
|
|
|
|
ConstructionFactory('nrcan',city1).enrich()
|
|
|
|
for building in city1.buildings:
|
|
for internal_zone in building.internal_zones:
|
|
for thermal_zone in internal_zone.thermal_zones:
|
|
for thermal_boundary in thermal_zone.thermal_boundaries:
|
|
for layer in thermal_boundary.layers:
|
|
print(thermal_boundary.internal_surface.type)
|
|
print(layer.material.name)
|
|
|