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 SpatialRuleLookup
public SpatialRule lookupRule(GHPoint point)
SpatialRuleLookup
SpatialRuleLookup.lookupRule(double, double)
for details.lookupRule
in interface SpatialRuleLookup
public SpatialRule getSpatialRule(int id)
SpatialRuleLookup
getSpatialRule
in interface SpatialRuleLookup
public int getSpatialId(SpatialRule rule)
SpatialRuleLookup
getSpatialId
in interface SpatialRuleLookup
public int size()
size
in interface SpatialRuleLookup
public BBox getBounds()
getBounds
in interface SpatialRuleLookup
Copyright © 2012–2019. All rights reserved.