Class LandmarkStorage

java.lang.Object
com.graphhopper.routing.lm.LandmarkStorage

public class LandmarkStorage extends Object
This class stores the landmark nodes and the weights from and to all other nodes in every subnetwork. This data is created to apply a speed-up for path calculation but at the same times stays flexible to per-request changes. The class is safe for usage from multiple reading threads across algorithms.
Author:
Peter Karich
  • Constructor Details

  • Method Details

    • setMaximumWeight

      public LandmarkStorage setMaximumWeight(double maxWeight)
      Specify the maximum possible value for your used area. With this maximum weight value you can influence the storage precision for your weights that help A* finding its way to the goal. The same value is used for all subnetworks. Note, if you pick this value too big then too similar weights are stored (some bits of the storage capability will be left unused). If too low then far away values will have the same maximum value associated ("maxed out"). Both will lead to bad performance.
      Parameters:
      maxWeight - use a negative value to automatically determine this value.
    • setLogDetails

      public void setLogDetails(boolean logDetails)
      By default do not log many details.
    • setLandmarkSuggestions

      public LandmarkStorage setLandmarkSuggestions(List<LandmarkSuggestion> landmarkSuggestions)
      This method forces the landmark preparation to skip the landmark search and uses the specified landmark list instead. Useful for manual tuning of larger areas to safe import time or improve quality.
    • setMinimumNodes

      public void setMinimumNodes(int minimumNodes)
      This method sets the required number of nodes of a subnetwork for which landmarks should be calculated. Every subnetwork below this count will be ignored.
    • getMinimumNodes

      public int getMinimumNodes()
      See Also:
    • setLMSelectionWeighting

      public void setLMSelectionWeighting(Weighting lmSelectionWeighting)
      This weighting is used for the selection heuristic and is per default not the weighting specified in the constructor. The special weighting leads to a much better distribution of the landmarks and results in better response times.
    • getLmSelectionWeighting

      public Weighting getLmSelectionWeighting()
    • getWeighting

      public Weighting getWeighting()
      This method returns the weighting for which the landmarks are originally created
    • getLMConfig

      public LMConfig getLMConfig()
    • createLandmarks

      public void createLandmarks()
      This method calculates the landmarks and initial weightings to & from them.
    • setAreaIndex

      public void setAreaIndex(AreaIndex<SplitArea> areaIndex)
      This method specifies the polygons which should be used to split the world wide area to improve performance and quality in this scenario.
    • findBorderEdgeIds

      protected com.carrotsearch.hppc.IntHashSet findBorderEdgeIds(AreaIndex<SplitArea> areaIndex)
      This method makes edges crossing the specified border inaccessible to split a bigger area into smaller subnetworks. This is important for the world wide use case to limit the maximum distance and also to detect unreasonable routes faster.
    • getLandmarkCount

      public int getLandmarkCount()
    • getLandmarks

      public int[] getLandmarks(int subnetwork)
    • getSubnetworksWithLandmarks

      public int getSubnetworksWithLandmarks()
      Returns:
      the number of subnetworks that have landmarks
    • isEmpty

      public boolean isEmpty()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • loadExisting

      public boolean loadExisting()
    • flush

      public void flush()
    • close

      public void close()
    • isClosed

      public boolean isClosed()
    • getCapacity

      public long getCapacity()