forked from s_ranjbar/city_retrofit
Add roof area to the persistence
This commit is contained in:
parent
04bf3bbef3
commit
061952eb17
|
@ -6,7 +6,7 @@ Project Coder Peter Yefi peteryefi@gmail.com
|
|||
"""
|
||||
|
||||
import logging
|
||||
from hub.persistence import Repository
|
||||
from hub.persistence.repository import Repository
|
||||
from hub.persistence.models import Application
|
||||
from hub.persistence.models import City
|
||||
from hub.persistence.models import CityObject
|
||||
|
|
|
@ -32,6 +32,7 @@ class CityObject(Models):
|
|||
total_heating_area = Column(Float, nullable=False)
|
||||
wall_area = Column(Float, nullable=False)
|
||||
windows_area = Column(Float, nullable=False)
|
||||
roof_area = Column(Float, nullable=False)
|
||||
system_name = Column(String, nullable=False)
|
||||
created = Column(DateTime, default=datetime.datetime.utcnow)
|
||||
updated = Column(DateTime, default=datetime.datetime.utcnow)
|
||||
|
@ -46,6 +47,7 @@ class CityObject(Models):
|
|||
self.usage = building.usages_percentage
|
||||
self.volume = building.volume
|
||||
self.area = building.floor_area
|
||||
self.roof_area = sum(roof.solid_polygon.area for roof in building.roofs)
|
||||
storeys = building.storeys_above_ground
|
||||
if storeys is None:
|
||||
storeys = building.max_height / building.average_storey_height
|
||||
|
|
Loading…
Reference in New Issue
Block a user