public final class GeoHash extends Object implements IHierarchicalGridCell, Serializable
Determine the hash for the rectangle containing the point (-73.700052, 42.678120) with a precision
of 10 characters
String hash = GeoHash.encode(-73.700052, 42.678120, 10).getHash();
Envelope bounds = GeoHash.decode("dredfcm606").getBounds();
| Modifier and Type | Method and Description |
|---|---|
IFeatureGeometry |
asFeatureGeometry()
Get the cell boundary as a geometry
|
static GeoHash |
decode(long bits,
int significantBits)
Determine the geohash for the specified set of bits.
|
static GeoHash |
decode(String hash)
Determine the geohash for the specified well-known string ID.
|
static List |
encode(double minX,
double minY,
double maxX,
double maxY,
int precision)
Get a list of GeoHashes that cover a rectangle at the specified precision.
|
static GeoHash |
encode(double longitude,
double latitude,
int precision)
Determine the cell that contains the specified point at the specified precision.
|
boolean |
equals(Object o) |
long |
getBits() |
Envelope |
getBounds()
Get the bounds of the grid cell.
|
List |
getChildren()
Get the children of the current cell.
|
String |
getHash()
Get the well-known string ID for the hash.
|
int |
hashCode() |
public long getBits()
public String getHash()
public Envelope getBounds()
public IFeatureGeometry asFeatureGeometry()
IGridCellasFeatureGeometry in interface IGridCellpublic List getChildren()
IHierarchicalGridCellgetChildren in interface IHierarchicalGridCellpublic static GeoHash encode(double longitude, double latitude, int precision)
longitude - The longitude value for the specified point.latitude - The latitude value for the specified point.precision - The length of the string key to be returned. The longer the string, the higher the
precision (i.e. smaller the rectangle).public static GeoHash decode(String hash)
hash - The well-known string ID.public static GeoHash decode(long bits, int significantBits)
bits - The bits that represent the geohash.significantBits - The number of bits that represent the geohash. This must be a multiple of 5.public static List encode(double minX, double minY, double maxX, double maxY, int precision)
minX - The x value of the lower-left corner to cover.minY - The y value of the lower-left corner to cover.maxX - The x value of the upper-right corner to cover.maxY - The y value of the upper-right corner to cover.precision - The length of the string key to be returned. The longer the string, the higher the
precision (i.e. smaller the rectangle).© 2007, 2022 Precisely. All rights reserved.