From d91da411fdb470ed9c2d5db33f5db2bff9fc4b8c Mon Sep 17 00:00:00 2001 From: guille Date: Tue, 15 Nov 2022 11:28:23 -0500 Subject: [PATCH] variable name correction, it will overwrite index and most likely case bugs in case of more than one scene. --- imports/geometry/gpandas.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/imports/geometry/gpandas.py b/imports/geometry/gpandas.py index 30658e52..ac9a0961 100644 --- a/imports/geometry/gpandas.py +++ b/imports/geometry/gpandas.py @@ -54,7 +54,7 @@ class GPandas: """ if self._city is None: self._city = City(self._lower_corner, self._upper_corner, self._srs_name) - for ix, bldg in self._scene.iterrows(): + for scene_index, bldg in self._scene.iterrows(): geom = bldg.geom polygon = ShapelyPoly(geom['coordinates'][0]) height = float(bldg['height_mean']) @@ -62,7 +62,7 @@ class GPandas: trimesh.repair.fill_holes(building_mesh) trimesh.repair.fix_winding(building_mesh) year_of_construction = int(bldg['year_built']) - name = str(ix) + name = str(scene_index) lod = 1 if year_of_construction > 2000: function = cte.RESIDENTIAL @@ -71,13 +71,13 @@ class GPandas: surfaces = [] face_normal = building_mesh.face_normals - for ix, face in enumerate(building_mesh.faces): + for face_index, face in enumerate(building_mesh.faces): points = [] for vertex_index in face: points.append(building_mesh.vertices[vertex_index]) solid_polygon = Polygon(points) perimeter_polygon = solid_polygon - s_type = cte.GROUND if face_normal[ix][2] == -1 else (cte.ROOF if face_normal[ix][2] == 1 else cte.WALL) + s_type = cte.GROUND if face_normal[face_index][2] == -1 else (cte.ROOF if face_normal[face_index][2] == 1 else cte.WALL) surface = Surface(solid_polygon, perimeter_polygon, surface_type=s_type) surfaces.append(surface) building = Building(name, lod, surfaces, year_of_construction, function, self._lower_corner, terrains=None)