public class GeohashUtils extends Object
Modifier and Type | Field and Description |
---|---|
static int |
MAX_PRECISION |
Modifier and Type | Method and Description |
---|---|
static Point |
decode(String geohash,
SpatialContext ctx)
Decodes the given geohash into a latitude and longitude
|
static Rectangle |
decodeBoundary(String geohash,
SpatialContext ctx)
Returns min-max lat, min-max lon.
|
static String |
encodeLatLon(double latitude,
double longitude)
Encodes the given latitude and longitude into a geohash
|
static String |
encodeLatLon(double latitude,
double longitude,
int precision) |
static String[] |
getSubGeohashes(String baseGeohash)
Array of geohashes 1 level below the baseGeohash.
|
static double[] |
lookupDegreesSizeForHashLen(int hashLen) |
static int |
lookupHashLenForWidthHeight(double lonErr,
double latErr)
Return the shortest geohash length that will have a width & height >= specified arguments.
|
public static final int MAX_PRECISION
public static String encodeLatLon(double latitude, double longitude)
latitude
- Latitude to encodelongitude
- Longitude to encodepublic static String encodeLatLon(double latitude, double longitude, int precision)
public static Point decode(String geohash, SpatialContext ctx)
geohash
- Geohash to deocdepublic static Rectangle decodeBoundary(String geohash, SpatialContext ctx)
public static String[] getSubGeohashes(String baseGeohash)
public static double[] lookupDegreesSizeForHashLen(int hashLen)
public static int lookupHashLenForWidthHeight(double lonErr, double latErr)
Copyright © 2015. All rights reserved.