Compare commits
2 Commits
6cd5154d05
...
646a603760
Author | SHA1 | Date | |
---|---|---|---|
646a603760 | |||
a5bfe725d9 |
|
@ -14,7 +14,7 @@ import hub.helpers.constants as cte
|
|||
from hub.exports.exports_factory import ExportsFactory
|
||||
from scripts.pv_sizing_and_simulation import PVSizingSimulation
|
||||
# Specify the GeoJSON file path
|
||||
geojson_file = process_geojson(x=-73.5681295982132, y=45.49218262677643, diff=0.0005)
|
||||
geojson_file = process_geojson(x=-73.5681295982132, y=45.49218262677643, diff=0.0001)
|
||||
file_path = (Path(__file__).parent / 'input_files' / 'output_buildings.geojson')
|
||||
# Specify the output path for the PDF file
|
||||
output_path = (Path(__file__).parent / 'out_files').resolve()
|
||||
|
@ -34,7 +34,7 @@ ExportsFactory('sra', city, output_path).export()
|
|||
sra_path = (output_path / f'{city.name}_sra.xml').resolve()
|
||||
subprocess.run(['sra', str(sra_path)])
|
||||
ResultFactory('sra', city, output_path).enrich()
|
||||
energy_plus_workflow(city)
|
||||
energy_plus_workflow(city, output_path=output_path)
|
||||
solar_angles = CitySolarAngles(city.name,
|
||||
city.latitude,
|
||||
city.longitude,
|
||||
|
|
|
@ -71,14 +71,14 @@ class DistrictHeatingNetworkCreator:
|
|||
city = json.load(file)
|
||||
|
||||
self.centroids = []
|
||||
self.building_ids = []
|
||||
self.building_names = []
|
||||
buildings = city['features']
|
||||
for building in buildings:
|
||||
coordinates = building['geometry']['coordinates'][0]
|
||||
building_polygon = Polygon(coordinates)
|
||||
centroid = building_polygon.centroid
|
||||
self.centroids.append(centroid)
|
||||
self.building_ids.append(building['id'])
|
||||
self.building_names.append(building['id'])
|
||||
|
||||
# Load road data
|
||||
with open(self.roads_file, 'r') as file:
|
||||
|
@ -281,8 +281,8 @@ class DistrictHeatingNetworkCreator:
|
|||
try:
|
||||
for i, centroid in enumerate(self.centroids):
|
||||
centroid_tuple = (centroid.x, centroid.y)
|
||||
building_id = self.building_ids[i]
|
||||
self.final_mst.add_node(centroid_tuple, type='building', id=building_id)
|
||||
building_name = self.building_names[i]
|
||||
self.final_mst.add_node(centroid_tuple, type='building', id=building_name)
|
||||
nearest_point = None
|
||||
min_distance = float('inf')
|
||||
for node in self.final_mst.nodes():
|
||||
|
|
Loading…
Reference in New Issue
Block a user