Package org.openstreetmap.josm.tools
Class GeoPropertyIndex<T>
java.lang.Object
org.openstreetmap.josm.tools.GeoPropertyIndex<T>
- Type Parameters:
T- the property (like land/water or nation)
Fast index to look up properties of the earth surface.
It is expected that there is a relatively slow method to look up the property for a certain coordinate and that there are larger areas with a uniform property.
This index tries to find rectangles with uniform property and caches them. Rectangles are subdivided, if there are different properties within. (Up to a maximum level, when the slow method is used again.)
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final booleanprivate final GeoProperty<T>private GeoPropertyIndex.GPLevel<T>private final intprivate final GeoPropertyIndex.GPLevel<T> -
Constructor Summary
ConstructorsConstructorDescriptionGeoPropertyIndex(GeoProperty<T> geoProp, int maxLevel) Create new GeoPropertyIndex. -
Method Summary
Modifier and TypeMethodDescriptionLook up the property for a certain point.final GeoProperty<T>Returns the geo property.toString()
-
Field Details
-
maxLevel
-
geoProp
-
root
-
lastLevelUsed
-
DEBUG
- See Also:
-
-
Constructor Details
-
GeoPropertyIndex
Create new GeoPropertyIndex.- Parameters:
geoProp- the input property that should be made faster by this indexmaxLevel- max level
-
-
Method Details
-
get
Look up the property for a certain point. This gives the same result asGeoProperty.get(LatLon), but should be faster.- Parameters:
ll- the point coordinates- Returns:
- property value at that point
-
getGeoProperty
Returns the geo property.- Returns:
- the geo property
- Since:
- 14484
-
toString
-