Class State

java.lang.Object
com.graphhopper.matching.State

public class State extends Object
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 Details

  • Method Details

    • getEntry

      public Observation getEntry()
    • getSnap

      public Snap 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

      public EdgeIteratorState getIncomingVirtualEdge()
      Returns the virtual edge that should be used by incoming paths.
      Throws:
      IllegalStateException - if this State is not directed.
    • getOutgoingVirtualEdge

      public EdgeIteratorState getOutgoingVirtualEdge()
      Returns the virtual edge that should be used by outgoing paths.
      Throws:
      IllegalStateException - if this State is not directed.
    • toString

      public String toString()
      Overrides:
      toString in class Object