fix error if there are no areas with an altitude
This commit is contained in:
parent
7aeecb085f
commit
831619c42a
1 changed files with 2 additions and 1 deletions
|
@ -313,7 +313,8 @@ class AltitudeArea(LevelGeometryMixin, models.Model):
|
|||
while repeat:
|
||||
repeat = False
|
||||
distances, predecessors = dijkstra(csgraph, directed=False, return_predecessors=True, unweighted=True)
|
||||
relevant_distances = distances[np.array(areas_with_altitude)[:, None], np.array(areas_with_altitude)]
|
||||
np_areas_with_altitude = np.array(areas_with_altitude, dtype=np.uint32)
|
||||
relevant_distances = distances[np_areas_with_altitude[:, None], np_areas_with_altitude]
|
||||
# noinspection PyTypeChecker
|
||||
for from_i, to_i in np.argwhere(np.logical_and(relevant_distances < np.inf, relevant_distances > 1)):
|
||||
from_area = areas[areas_with_altitude[from_i]]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue