Class WayToEdgeConverter

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

public class WayToEdgeConverter extends Object
  • Constructor Details

    • WayToEdgeConverter

      public WayToEdgeConverter(BaseGraph baseGraph, LongFunction<Iterator<com.carrotsearch.hppc.cursors.IntCursor>> edgesByWay)
  • Method Details

    • convertForViaNode

      public WayToEdgeConverter.NodeResult convertForViaNode(com.carrotsearch.hppc.LongArrayList fromWays, int viaNode, com.carrotsearch.hppc.LongArrayList toWays) throws OSMRestrictionException
      Finds the edge IDs associated with the given OSM ways that are adjacent to the given via-node. For each way there can be multiple edge IDs and there should be exactly one that is adjacent to the via-node for each way. Otherwise we throw OSMRestrictionException
      Throws:
      OSMRestrictionException
    • convertForViaWays

      public WayToEdgeConverter.EdgeResult convertForViaWays(com.carrotsearch.hppc.LongArrayList fromWays, com.carrotsearch.hppc.LongArrayList viaWays, com.carrotsearch.hppc.LongArrayList toWays) throws OSMRestrictionException
      Finds the edge IDs associated with the given OSM ways that are adjacent to each other. For example for given from-, via- and to-ways there can be multiple edges associated with each (because each way can be split into multiple edges). We then need to find the from-edge that is connected with one of the via-edges which in turn must be connected with one of the to-edges. We use DFS/backtracking to do this. There can also be *multiple* via-ways, but the concept is the same. Note that there can also be multiple from- or to-*ways*, but only one of each of them should be considered at a time. In contrast to the via-ways there are only multiple from/to-ways, because of restrictions like no_entry or no_exit where there can be multiple from- or to-members. So we need to find one edge-chain for each pair of from- and to-ways. Besides the edge IDs we also return the node IDs that connect the edges, so we can add turn restrictions at these nodes later.
      Throws:
      OSMRestrictionException