fix error when empty areas are somewhere…
This commit is contained in:
parent
7575fd5de2
commit
e009acaaf0
1 changed files with 2 additions and 2 deletions
|
@ -250,7 +250,7 @@ class Graph:
|
||||||
return (), None, None
|
return (), None, None
|
||||||
points, distances, ctypes = zip(*((point, distance, ctype) for point, (distance, ctype) in points.items()))
|
points, distances, ctypes = zip(*((point, distance, ctype) for point, (distance, ctype) in points.items()))
|
||||||
distances = {points[i]: distance for i, distance in enumerate(distances)}
|
distances = {points[i]: distance for i, distance in enumerate(distances)}
|
||||||
points = np.array(points)
|
points = np.array(points, dtype=np.int)
|
||||||
return points, distances, ctypes
|
return points, distances, ctypes
|
||||||
try:
|
try:
|
||||||
if isinstance(location, AreaLocation):
|
if isinstance(location, AreaLocation):
|
||||||
|
@ -258,7 +258,7 @@ class Graph:
|
||||||
return points, None, None
|
return points, None, None
|
||||||
elif isinstance(location, LocationGroup):
|
elif isinstance(location, LocationGroup):
|
||||||
points = tuple(np.hstack(tuple(self.get_location_points(area, mode)[0]
|
points = tuple(np.hstack(tuple(self.get_location_points(area, mode)[0]
|
||||||
for area in location.arealocations.all())))
|
for area in location.arealocations.all())).astype(np.int))
|
||||||
return points, None, None
|
return points, None, None
|
||||||
except KeyError:
|
except KeyError:
|
||||||
raise NotYetRoutable
|
raise NotYetRoutable
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue