Class GraphRestriction

java.lang.Object
com.graphhopper.reader.osm.GraphRestriction

public class GraphRestriction extends Object
Basically an OSM restriction, but in 'graph-representation', i.e. it is expressed in terms of graph node/edge IDs instead of OSM way IDs. There can be via-node-restrictions (with a single via-node) and via-way/edge-restrictions (with one or more via-edges). There can also be multiple from- or to-edges to represent OSM restrictions like no_entry or no_exit that use multiple from- or to-members.

We store a list of via-nodes even for via-way restrictions. It stores the nodes connecting the via-ways, see WayToEdgeConverter.EdgeResult. For via-node restrictions the list simply contains the single via node.

This class only contains the 'topology' of the restriction. The RestrictionType is handled separately, because opposite to the type the topology does not depend on the vehicle type.

  • Method Summary

    Modifier and Type
    Method
    Description
    com.carrotsearch.hppc.IntArrayList
     
    com.carrotsearch.hppc.IntArrayList
     
    com.carrotsearch.hppc.IntArrayList
     
    com.carrotsearch.hppc.IntArrayList
     
    boolean
     
    node(int fromEdge, int viaNode, int toEdge)
     
    node(com.carrotsearch.hppc.IntArrayList fromEdges, int viaNode, com.carrotsearch.hppc.IntArrayList toEdges)
     
    way(int fromEdge, int viaEdge, int toEdge, com.carrotsearch.hppc.IntArrayList viaNodes)
     
    way(int fromEdge, com.carrotsearch.hppc.IntArrayList viaEdges, int toEdge, com.carrotsearch.hppc.IntArrayList viaNodes)
     
    way(com.carrotsearch.hppc.IntArrayList fromEdges, com.carrotsearch.hppc.IntArrayList viaEdges, com.carrotsearch.hppc.IntArrayList toEdges, com.carrotsearch.hppc.IntArrayList viaNodes)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • node

      public static GraphRestriction node(int fromEdge, int viaNode, int toEdge)
    • node

      public static GraphRestriction node(com.carrotsearch.hppc.IntArrayList fromEdges, int viaNode, com.carrotsearch.hppc.IntArrayList toEdges)
    • way

      public static GraphRestriction way(int fromEdge, int viaEdge, int toEdge, com.carrotsearch.hppc.IntArrayList viaNodes)
    • way

      public static GraphRestriction way(int fromEdge, com.carrotsearch.hppc.IntArrayList viaEdges, int toEdge, com.carrotsearch.hppc.IntArrayList viaNodes)
    • way

      public static GraphRestriction way(com.carrotsearch.hppc.IntArrayList fromEdges, com.carrotsearch.hppc.IntArrayList viaEdges, com.carrotsearch.hppc.IntArrayList toEdges, com.carrotsearch.hppc.IntArrayList viaNodes)
    • isViaWayRestriction

      public boolean isViaWayRestriction()
    • getViaNodes

      public com.carrotsearch.hppc.IntArrayList getViaNodes()
    • getFromEdges

      public com.carrotsearch.hppc.IntArrayList getFromEdges()
    • getViaEdges

      public com.carrotsearch.hppc.IntArrayList getViaEdges()
    • getToEdges

      public com.carrotsearch.hppc.IntArrayList getToEdges()