From 05b9a4267243b109471cf5931e635da0ef318f7e Mon Sep 17 00:00:00 2001 From: Majid Rezaei Date: Wed, 31 Jul 2024 11:27:52 -0400 Subject: [PATCH] chore: changing building_id to building_name in dhn generator --- .../district_heating_network_creator.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/district_heating_network/district_heating_network_creator.py b/scripts/district_heating_network/district_heating_network_creator.py index 683f8808..e66e3e2c 100644 --- a/scripts/district_heating_network/district_heating_network_creator.py +++ b/scripts/district_heating_network/district_heating_network_creator.py @@ -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():