fix space not exclusion
This commit is contained in:
parent
06ea24bf10
commit
75db1b3ac3
1 changed files with 3 additions and 2 deletions
|
@ -391,8 +391,9 @@ class Router:
|
|||
graph[waytype.nonupwards_indices.transpose().tolist()] *= 100000
|
||||
|
||||
# exclude spaces and edges
|
||||
graph[tuple(restrictions.spaces), :] = np.inf
|
||||
graph[:, tuple(restrictions.spaces)] = np.inf
|
||||
space_nodes = tuple(reduce(operator.or_, (self.spaces[space] for space in restrictions.spaces), set()))
|
||||
graph[space_nodes, :] = np.inf
|
||||
graph[:, space_nodes] = np.inf
|
||||
graph[restrictions.edges.transpose().tolist()] = np.inf
|
||||
|
||||
distances, predecessors = shortest_path(graph, directed=True, return_predecessors=True)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue