public final class GeoEncodingUtils extends Object
| Modifier and Type | Class and Description | 
|---|---|
static class  | 
GeoEncodingUtils.DistancePredicate
A predicate that checks whether a given point is within a distance of another point. 
 | 
static class  | 
GeoEncodingUtils.PolygonPredicate
A predicate that checks whether a given point is within a polygon. 
 | 
| Modifier and Type | Field and Description | 
|---|---|
static short | 
BITS
number of bits used for quantizing latitude and longitude values 
 | 
static int | 
MAX_LON_ENCODED  | 
static int | 
MIN_LON_ENCODED  | 
| Modifier and Type | Method and Description | 
|---|---|
static GeoEncodingUtils.DistancePredicate | 
createDistancePredicate(double lat,
                       double lon,
                       double radiusMeters)
Create a predicate that checks whether points are within a distance of a given point. 
 | 
static GeoEncodingUtils.PolygonPredicate | 
createPolygonPredicate(Polygon[] polygons,
                      Polygon2D tree)
Create a predicate that checks whether points are within a polygon. 
 | 
static double | 
decodeLatitude(byte[] src,
              int offset)
Turns quantized value from byte array back into a double. 
 | 
static double | 
decodeLatitude(int encoded)
Turns quantized value from  
encodeLatitude(double) back into a double. | 
static double | 
decodeLongitude(byte[] src,
               int offset)
Turns quantized value from byte array back into a double. 
 | 
static double | 
decodeLongitude(int encoded)
Turns quantized value from  
encodeLongitude(double) back into a double. | 
static int | 
encodeLatitude(double latitude)
Quantizes double (64 bit) latitude into 32 bits (rounding down: in the direction of -90) 
 | 
static int | 
encodeLatitudeCeil(double latitude)
Quantizes double (64 bit) latitude into 32 bits (rounding up: in the direction of +90) 
 | 
static int | 
encodeLongitude(double longitude)
Quantizes double (64 bit) longitude into 32 bits (rounding down: in the direction of -180) 
 | 
static int | 
encodeLongitudeCeil(double longitude)
Quantizes double (64 bit) longitude into 32 bits (rounding up: in the direction of +180) 
 | 
public static final short BITS
public static final int MIN_LON_ENCODED
public static final int MAX_LON_ENCODED
public static int encodeLatitude(double latitude)
latitude - latitude value: must be within standard +/-90 coordinate bounds.intIllegalArgumentException - if latitude is out of boundspublic static int encodeLatitudeCeil(double latitude)
latitude - latitude value: must be within standard +/-90 coordinate bounds.intIllegalArgumentException - if latitude is out of boundspublic static int encodeLongitude(double longitude)
longitude - longitude value: must be within standard +/-180 coordinate bounds.intIllegalArgumentException - if longitude is out of boundspublic static int encodeLongitudeCeil(double longitude)
longitude - longitude value: must be within standard +/-180 coordinate bounds.intIllegalArgumentException - if longitude is out of boundspublic static double decodeLatitude(int encoded)
encodeLatitude(double) back into a double.encoded - encoded value: 32-bit quantized value.public static double decodeLatitude(byte[] src,
                                    int offset)
src - byte array containing 4 bytes to decode at offsetoffset - offset into src to decode from.public static double decodeLongitude(int encoded)
encodeLongitude(double) back into a double.encoded - encoded value: 32-bit quantized value.public static double decodeLongitude(byte[] src,
                                     int offset)
src - byte array containing 4 bytes to decode at offsetoffset - offset into src to decode from.public static GeoEncodingUtils.DistancePredicate createDistancePredicate(double lat, double lon, double radiusMeters)
public static GeoEncodingUtils.PolygonPredicate createPolygonPredicate(Polygon[] polygons, Polygon2D tree)
createDistancePredicate(double, double, double).Copyright © 2000-2019 Apache Software Foundation. All Rights Reserved.