fix space not exclusion

This commit is contained in:
Laura Klünder 2017-12-27 12:06:17 +01:00
parent 06ea24bf10
commit 75db1b3ac3

View file

@ -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)