public class WayConnectionTypeCalculator extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private int |
firstGroupIdx |
private int |
lastBackwardWay |
private int |
lastForwardWay |
private java.util.List<RelationMember> |
members |
private boolean |
onewayBeginning |
private static int |
UNCONNECTED |
Constructor and Description |
---|
WayConnectionTypeCalculator() |
Modifier and Type | Method and Description |
---|---|
private WayConnectionType.Direction |
determineDirection(int ref_i,
WayConnectionType.Direction ref_direction,
int k) |
private WayConnectionType.Direction |
determineDirection(int ref_i,
WayConnectionType.Direction ref_direction,
int k,
boolean reversed)
Determines the direction of way
k with respect to the way ref_i . |
private WayConnectionType.Direction |
determineDirectionOfFirst(int i,
RelationMember m) |
private void |
determineOnewayConnectionType(java.util.List<WayConnectionType> con,
RelationMember m,
int i,
WayConnectionType wct) |
private void |
makeLoopIfNeeded(java.util.List<WayConnectionType> con,
int i) |
private static WayConnectionType.Direction |
reverse(WayConnectionType.Direction dir) |
java.util.List<WayConnectionType> |
updateLinks(java.util.List<RelationMember> members)
refresh the cache of member WayConnectionTypes
|
private static final int UNCONNECTED
private java.util.List<RelationMember> members
private int firstGroupIdx
private int lastForwardWay
private int lastBackwardWay
private boolean onewayBeginning
public WayConnectionTypeCalculator()
public java.util.List<WayConnectionType> updateLinks(java.util.List<RelationMember> members)
members
- relation membersprivate void makeLoopIfNeeded(java.util.List<WayConnectionType> con, int i)
private WayConnectionType.Direction determineDirectionOfFirst(int i, RelationMember m)
private void determineOnewayConnectionType(java.util.List<WayConnectionType> con, RelationMember m, int i, WayConnectionType wct)
private static WayConnectionType.Direction reverse(WayConnectionType.Direction dir)
private WayConnectionType.Direction determineDirection(int ref_i, WayConnectionType.Direction ref_direction, int k)
private WayConnectionType.Direction determineDirection(int ref_i, WayConnectionType.Direction ref_direction, int k, boolean reversed)
k
with respect to the way ref_i
.
The way ref_i
is assumed to have the direction ref_direction
and to be the predecessor of k
.
If both ways are not linked in any way, NONE is returned.
Else the direction is given as follows:
Let the relation be a route of oneway streets, and someone travels them in the given order.
Direction is FORWARD if it is legal and BACKWARD if it is illegal to do so for the given way.ref_i
- way keyref_direction
- direction of ref_ik
- successor of ref_ireversed
- if true
determine reverse directionk