public class H3 extends Object implements IGridCell, Serializable
Determine the H3 grid cell containing the point (-73.700052, 42.678120) with a resolution of 10 characters
H3 h3cell = H3.encode(-73.700052, 42.678120, 10);
String hash = h3cell.getHash();
H3 h3cell = H3.decode("8a2b8915eb97fff");
Envelope bounds = h3cell.getBounds();
| Modifier and Type | Method and Description |
|---|---|
IFeatureGeometry |
asFeatureGeometry()
Get the cell boundary as a geometry
|
static H3 |
decode(long bits)
Determine the H3 grid cell for the specified ID.
|
static H3 |
decode(String hash)
Determine the H3 grid cell for the specified well-known string ID.
|
static H3 |
encode(double longitude,
double latitude,
int resolution)
Determine the H3 cell that contains the specified point at the specified resolution.
|
boolean |
equals(Object o) |
long |
getBits()
Get the long representation of the grid cell.
|
Envelope |
getBounds()
Get the bounds of the grid cell.
|
List |
getChildren(int resolution)
Get the children of this grid cell at the specified resolution.
|
String |
getHash()
Get the well-known string ID for the grid cell.
|
H3 |
getParent(int resolution)
Get the parent of this grid cell at the specified resolution.
|
int |
getResolution()
Get the resolution of the grid cell.
|
int |
hashCode() |
public long getBits()
public int getResolution()
public String getHash()
IGridCellpublic Envelope getBounds()
IGridCellpublic IFeatureGeometry asFeatureGeometry()
IGridCellasFeatureGeometry in interface IGridCellpublic static H3 encode(double longitude, double latitude, int resolution)
longitude - The longitude value for the specified point.latitude - The latitude value for the specified point.resolution - The resolution for the grid cell. The larger the value, the smaller the grid cell. Must be
greater than 0 and less than or equal to 15.public static H3 decode(String hash)
hash - The well-known string ID.public static H3 decode(long bits)
bits - The grid cell ID.public H3 getParent(int resolution)
resolution - The resolution of the parent. Must be greater than 0 and less than this cell's resolution.public List getChildren(int resolution)
resolution - The resolution of the children. Must be greater than this cell's resolution and less than or equal to 15.© 2007, 2022 Precisely. All rights reserved.