re-introduced shared walls = 0 for no neighbours

This commit is contained in:
Pilar Monsalvete 2023-03-20 11:40:20 -04:00
parent 6bbc300730
commit d4fc6aa27d

View File

@ -133,8 +133,9 @@ class Geojson:
@staticmethod
def _find_wall(line_1, line_2):
for i in range(0, 2):
j = 1 - i
point_1 = line_1[i]
point_2 = line_2[i]
point_2 = line_2[j]
distance = GeometryHelper.distance_between_points(point_1, point_2)
if distance > 1e-2:
return False
@ -143,6 +144,8 @@ class Geojson:
def _store_shared_percentage_to_walls(self, city, city_mapped):
for building in city.buildings:
if building.name not in city_mapped.keys():
for wall in building.walls:
wall.percentage_shared = 0
continue
building_mapped = city_mapped[building.name]
for wall in building.walls:
@ -151,12 +154,8 @@ class Geojson:
for point in wall.perimeter_polygon.coordinates:
if point[2] < 0.5:
ground_line.append(point)
# todo: erase when we have no triangulation
if len(ground_line) < 2:
continue
# todo: erase down to here
for entry in building_mapped:
if building_mapped[entry]['shared_points'] <= 5:
if building_mapped[entry]['shared_points'] <= 3:
continue
line = [building_mapped[entry]['line_start'], building_mapped[entry]['line_end']]
neighbour_line = [building_mapped[entry]['neighbour_line_start'],