Package com.graphhopper.matching
Class State
java.lang.Object
com.graphhopper.matching.State
During map matching this represents a map matching candidate, i.e. a potential snapped
point of a GPX entry. After map matching, this represents the map matched point of
an GPX entry.
A Observation can either be at an undirected real (tower) node or at a directed virtual node.
If this is at a directed virtual node then incoming paths from any previous State
should arrive through getIncomingVirtualEdge() and outgoing paths to any following
State should start with getOutgoingVirtualEdge(). This is achieved by
penalizing other edges for routing. Note that virtual nodes are always connected to their
adjacent nodes via 2 virtual edges (not counting reverse virtual edges).
- Author:
- Peter Karich, kodonnell, Stefan Holder
-
Constructor Summary
ConstructorsConstructorDescriptionState(Observation entry, Snap snap) Creates an undirected candidate for a real node.State(Observation entry, Snap snap, VirtualEdgeIteratorState incomingVirtualEdge, VirtualEdgeIteratorState outgoingVirtualEdge) Creates a directed candidate for a virtual node. -
Method Summary
-
Constructor Details
-
State
Creates an undirected candidate for a real node. -
State
public State(Observation entry, Snap snap, VirtualEdgeIteratorState incomingVirtualEdge, VirtualEdgeIteratorState outgoingVirtualEdge) Creates a directed candidate for a virtual node.
-
-
Method Details
-
getEntry
-
getSnap
-
isOnDirectedEdge
public boolean isOnDirectedEdge()Returns whether this State is directed. This is true if the snapped point is a virtual node, otherwise the snapped node is a real (tower) node and false is returned. -
getIncomingVirtualEdge
Returns the virtual edge that should be used by incoming paths.- Throws:
IllegalStateException- if this State is not directed.
-
getOutgoingVirtualEdge
Returns the virtual edge that should be used by outgoing paths.- Throws:
IllegalStateException- if this State is not directed.
-
toString
-