public class DirectionResolver extends Object
Example:
.a x b --- o ---
If the location 'x' should be on the left side the incoming edge would be 'a' and the outgoing edge would be 'b'. If the location 'x' should be on the right side the incoming edge would be 'b' and the outgoing edge would be 'a'.
The returned edge IDs can have some special values: we use EdgeIterator.NO_EDGE
to indicate it is
not possible to arrive or leave a location in a certain direction and EdgeIterator.ANY_EDGE
if
there was no clear way to determine an edge id.
There are a few special cases:
- if it is not possible to determine a clear result, such as for junctions with multiple adjacent edges
we return DirectionResolverResult.unrestricted()
}
- if there is no way to reach or leave a location at all we return DirectionResolverResult.impossible()
- for locations where the location can only possibly be on the left or right side (such as one-ways we return
DirectionResolverResult.onlyLeft(int, int)
or DirectionResolverResult.onlyRight(int, int)
Constructor and Description |
---|
DirectionResolver(Graph graph,
BooleanEncodedValue accessEnc) |
Modifier and Type | Method and Description |
---|---|
DirectionResolverResult |
resolveDirections(int node,
GHPoint location) |
public DirectionResolver(Graph graph, BooleanEncodedValue accessEnc)
public DirectionResolverResult resolveDirections(int node, GHPoint location)
node
- the node for which the incoming/outgoing edges should be determinedlocation
- the location next to the road relative to which the 'left' and 'right' side edges should be determinedDirectionResolver
Copyright © 2012–2020. All rights reserved.