public class SpatialRuleLookupArray extends Object implements SpatialRuleLookup
EMPTY| Constructor and Description |
|---|
SpatialRuleLookupArray(List<SpatialRule> spatialRules,
double resolution,
boolean exact,
BBox bounds) |
| Modifier and Type | Method and Description |
|---|---|
BBox |
getBounds() |
int |
getSpatialId(SpatialRule rule)
This method returns an identification number from 0 to size (exclusive) for the specified rule.
|
SpatialRule |
getSpatialRule(int id)
This method returns the SpatialRule for a given Spatial Id.
|
SpatialRule |
lookupRule(double lat,
double lon)
Return an applicable rule for this location.
|
SpatialRule |
lookupRule(GHPoint point)
See
SpatialRuleLookup.lookupRule(double, double) for details. |
int |
size() |
public SpatialRuleLookupArray(List<SpatialRule> spatialRules, double resolution, boolean exact, BBox bounds)
spatialRules - the spatial rulesresolution - of the array in decimal degrees, see: https://en.wikipedia.org/wiki/Decimal_degrees
The downside of using decimal degrees is that this is not fixed to a certain m range asexact - if exact it will also perform a polygon contains for border tiles, might fail for small holes
in the Polygon that are not represented in the tile array.bounds - create the SpatialRuleLookup for the given BBoxpublic SpatialRule lookupRule(double lat, double lon)
SpatialRuleLookup
If the requested location is outside of the supported bounds or no SpatialRule is registered at this location
SpatialRule.EMPTY is returned.
lookupRule in interface SpatialRuleLookuppublic SpatialRule lookupRule(GHPoint point)
SpatialRuleLookupSpatialRuleLookup.lookupRule(double, double) for details.lookupRule in interface SpatialRuleLookuppublic SpatialRule getSpatialRule(int id)
SpatialRuleLookupgetSpatialRule in interface SpatialRuleLookuppublic int getSpatialId(SpatialRule rule)
SpatialRuleLookupgetSpatialId in interface SpatialRuleLookuppublic int size()
size in interface SpatialRuleLookuppublic BBox getBounds()
getBounds in interface SpatialRuleLookupCopyright © 2012–2019. All rights reserved.