com.pb.lisdk.grid.h3

## Class H3

- java.lang.Object
- - com.pb.lisdk.grid.h3.H3

All Implemented Interfaces:
  IGridCell, Serializable

    public class H3
    extends Object
    implements IGridCell, Serializable

A wrapper of Uber's H3 library.

### Examples

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();

Determine the bounds of the hash "8a2b8915eb97fff"

              H3 h3cell = H3.decode("8a2b8915eb97fff");
                    Envelope bounds = h3cell.getBounds();

See Also:
  H3: Uber’s Hexagonal Hierarchical Spatial Index, A hexagonal hierarchical geospatial indexing system, Serialized Form

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`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()`

### Methods inherited from class java.lang.Object

`getClass, notify, notifyAll, toString, wait, wait, wait`

### Method Detail

#### getBits

    public long getBits()

Get the long representation of the grid cell.

#### getResolution

    public int getResolution()

Get the resolution of the grid cell.

Returns:
  The resolution of the grid cell. Will be greater than 0 and less than or equal to 15.

#### getHash

    public String getHash()

Description copied from interface: `IGridCell`
Get the well-known string ID for the grid cell.

Specified by:
  `getHash` in interface `IGridCell`

#### getBounds

    public Envelope getBounds()

Description copied from interface: `IGridCell`
Get the bounds of the grid cell.

Specified by:
  `getBounds` in interface `IGridCell`

#### asFeatureGeometry

    public IFeatureGeometry asFeatureGeometry()

Description copied from interface: `IGridCell`
Get the cell boundary as a geometry

Specified by:
  `asFeatureGeometry` in interface `IGridCell`

#### equals

    public boolean equals(Object o)

Overrides:
  `equals` in class `Object`

#### hashCode

    public int hashCode()

Overrides:
  `hashCode` in class `Object`

#### encode

    public static H3 encode(double longitude,
                            double latitude,
                            int resolution)

Determine the H3 cell that contains the specified point at the specified resolution.

Parameters:
  `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.

#### decode

    public static H3 decode(String hash)

Determine the H3 grid cell for the specified well-known string ID.

Parameters:
  `hash` - The well-known string ID.
Returns:
  A representation of the H3 grid cell.

#### decode

    public static H3 decode(long bits)

Determine the H3 grid cell for the specified ID.

Parameters:
  `bits` - The grid cell ID.
Returns:
  A representation of the H3 grid cell.

#### getParent

    public H3 getParent(int resolution)

Get the parent of this grid cell at the specified resolution.

Parameters:
  `resolution` - The resolution of the parent. Must be greater than 0 and less than this cell's resolution.

#### getChildren

    public List getChildren(int resolution)

Get the children of this grid cell at the specified resolution.

Parameters:
  `resolution` - The resolution of the children. Must be greater than this cell's resolution and less than or equal to 15.