public class GeoHashExtensions extends Object
GeoHashExtensions. This class is based on http://en.wikipedia.org/wiki/Geohash.| Constructor and Description |
|---|
GeoHashExtensions() |
| Modifier and Type | Method and Description |
|---|---|
static double[] |
decode(String geohash)
Decode the given geohash into a latitude and longitude.
|
static double[] |
decodeAndRound(String geohash)
Decodes the given geohash into a latitude and longitude.
|
static String |
encode(double latitude,
double longitude)
Encodes the given latitude and longitude into a geohash code.
|
static String |
getAdjacent(String geohash,
String... directions)
Gets the adjacent from the given directions.
|
static String |
getAdjacent(String geohash,
String direction)
Gets the adjacent from the given direction.
|
static List<String> |
getAllAdjacentAreasList(String geohash)
Gets the all adjacent areas list.
|
static Map<String,String> |
getAllAdjacentAreasMap(String geohash)
Gets the geohash cells around the given geohash cell.
|
static FirstAndSecondRingRegion |
getFirstAndSecondRingRegion(String geohash)
Gets the geohash cells of the first and second ring region around the given geohash cell as a
FirstAndSecondRingRegion object. |
static FirstRingRegion |
getFirstRingRegion(String geohash)
Gets the geohash cells around the given geohash cell as a
FirstRingRegion object. |
static double |
getLatitude(String geohash)
Gets the latitude from the given geohash value.
|
static double |
getLongitude(String geohash)
Gets the longitude from the given geohash value.
|
static Map<String,String> |
getTwentyFiveAreasMap(String geohash)
Gets the eight cells around the given geohash cell so the first ring inclusive the given
geohash cell and cells from the second ring.
|
static void |
main(String[] args)
The main method.
|
public static double[] decode(String geohash)
geohash - the geohashpublic static double[] decodeAndRound(String geohash)
geohash - the geohashpublic static String encode(double latitude, double longitude)
latitude - the latitudelongitude - the longitudepublic static String getAdjacent(String geohash, String direction)
geohash - the geohashdirection - the directionpublic static String getAdjacent(String geohash, String... directions)
geohash - the geohashdirections - the directionspublic static List<String> getAllAdjacentAreasList(String geohash)
geohash - the geohashpublic static Map<String,String> getAllAdjacentAreasMap(String geohash)
geohash - the geohashpublic static FirstAndSecondRingRegion getFirstAndSecondRingRegion(String geohash)
FirstAndSecondRingRegion object.geohash - the geohash cell.FirstAndSecondRingRegion that encapsulates the cells of the first and
second ring region around the given geohash cell.public static FirstRingRegion getFirstRingRegion(String geohash)
FirstRingRegion object.geohash - the geohash cell.FirstRingRegion object calculated from the given geohash value.public static double getLatitude(String geohash)
geohash - the geohashpublic static double getLongitude(String geohash)
geohash - the geohashpublic static Map<String,String> getTwentyFiveAreasMap(String geohash)
geohash - the geohashpublic static void main(String[] args)
args - the argumentsCopyright © 2010–2017 Alpha Ro Group UG (haftungsbeschrÀngt). All rights reserved.