fix space not exclusion
@@ -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)
