Package org.openstreetmap.josm.tools
Class GeoPropertyIndex.GPLevel<T>
java.lang.Object
org.openstreetmap.josm.tools.GeoPropertyIndex.GPLevel<T>
- Enclosing class:
- GeoPropertyIndex<T>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final BBoxprivate GeoPropertyIndex.GPLevel<T>[]private final intprivate final GeoPropertyIndex<T>private final GeoPropertyIndex.GPLevel<T>private final T -
Constructor Summary
ConstructorsConstructorDescriptionGPLevel(int level, BBox bbox, GeoPropertyIndex.GPLevel<T> parent, GeoPropertyIndex<T> owner) -
Method Summary
Modifier and TypeMethodDescriptionprivate voidgenerateChild(GeoPropertyIndex.GPLevel<T>[] currentChildren, BBox testBBox, int idx) Safely generate the child in a multi-threaded environmentprivate BBoxgenerateTestBBox(int idx, double lon2, double lat2) Generate the bbox for the specified index in thegetChildren()arrayprivate TgetBounded(LatLon ll) private GeoPropertyIndex.GPLevel<T>[]Get the children array safely in a multi-threaded environment.(package private) booleanChecks, if a point is inside this tile.(package private) booleanChecks, if a point is inside this tile.toString()
-
Field Details
-
val
-
level
-
bbox
-
parent
-
owner
-
children
-
-
Constructor Details
-
GPLevel
-
-
Method Details
-
get
-
getBounded
-
generateTestBBox
Generate the bbox for the specified index in thegetChildren()array- Parameters:
idx- The index in thegetChildren()arraylon2- The longitude of the center of the previous levellat2- The latitude of the center of the previous level- Returns:
- The test bbox for the specified index in the
getChildren()array
-
generateChild
Safely generate the child in a multi-threaded environment- Parameters:
currentChildren- The children array to checktestBBox- The current bbox (will be used to create the newGeoPropertyIndex.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 thatTerritories.getRegionalTaginfoUrls(LatLon)uses aCollection.parallelStream().- Returns:
- The children array (sw, nw, se, ne)
-
isInside
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
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 tilell- the coordinates of the point- Returns:
- true, if it is inside of the box
-
toString
-