Class GeoPropertyIndex.GPLevel<T>

java.lang.Object
org.openstreetmap.josm.tools.GeoPropertyIndex.GPLevel<T>
Enclosing class:
GeoPropertyIndex<T>

protected static class GeoPropertyIndex.GPLevel<T> extends Object
  • Field Details

  • Constructor Details

  • Method Details

    • get

      public T get(LatLon ll)
    • getBounded

      private T getBounded(LatLon ll)
    • generateTestBBox

      private BBox generateTestBBox(int idx, double lon2, double lat2)
      Generate the bbox for the specified index in the getChildren() array
      Parameters:
      idx - The index in the getChildren() array
      lon2 - The longitude of the center of the previous level
      lat2 - The latitude of the center of the previous level
      Returns:
      The test bbox for the specified index in the getChildren() array
    • generateChild

      private void generateChild(GeoPropertyIndex.GPLevel<T>[] currentChildren, BBox testBBox, int idx)
      Safely generate the child in a multi-threaded environment
      Parameters:
      currentChildren - The children array to check
      testBBox - The current bbox (will be used to create the new GeoPropertyIndex.GPLevel)
      idx - The index in the child array
    • getChildren

      Get the children array safely in a multi-threaded environment. If this ends up being a performance issue, look up the "immutable" double-checked locking idiom. Just be certain you have a good test when checking the performance differences. See #23309/#23036. The issue there is that Territories.getRegionalTaginfoUrls(LatLon) uses a Collection.parallelStream().
      Returns:
      The children array (sw, nw, se, ne)
    • isInside

      boolean isInside(ILatLon ll)
      Checks, if a point is inside this tile. Makes sure, that neighboring tiles do not overlap, i.e. a point exactly on the border of two tiles must be inside exactly one of the tiles.
      Parameters:
      ll - the coordinates of the point
      Returns:
      true, if it is inside of the box
    • isInside

      boolean isInside(BBox bbox, ILatLon ll)
      Checks, if a point is inside this tile. Makes sure, that neighboring tiles do not overlap, i.e. a point exactly on the border of two tiles must be inside exactly one of the tiles.
      Parameters:
      bbox - the tile
      ll - the coordinates of the point
      Returns:
      true, if it is inside of the box
    • toString

      public String toString()
      Overrides:
      toString in class Object