fix error for areas with no nodes
This commit is contained in:
parent
78a046f5b0
commit
08d947226d
1 changed files with 2 additions and 1 deletions
|
@ -220,9 +220,10 @@ class Router:
|
||||||
if edge.access_restriction:
|
if edge.access_restriction:
|
||||||
restrictions.setdefault(edge.access_restriction, RouterRestriction()).edges.append(index)
|
restrictions.setdefault(edge.access_restriction, RouterRestriction()).edges.append(index)
|
||||||
|
|
||||||
|
# respect slow_down_factor
|
||||||
for area in areas.values():
|
for area in areas.values():
|
||||||
if area.slow_down_factor != 1:
|
if area.slow_down_factor != 1:
|
||||||
area_nodes = np.array(area.nodes)
|
area_nodes = np.array(area.nodes, dtype=np.uint32)
|
||||||
graph[area_nodes.reshape((-1, 1)), area_nodes] *= float(area.slow_down_factor)
|
graph[area_nodes.reshape((-1, 1)), area_nodes] *= float(area.slow_down_factor)
|
||||||
|
|
||||||
# finalize waytype matrixes
|
# finalize waytype matrixes
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue