Skip to main content
Version: 4.x

Indexing functions

These function are used for finding the H3 cell index containing coordinates, and for finding the center and boundary of H3 indexes.

pointToCell#

H3Error pointToCell(const GeoPoint *g, int res, H3Index *out);

Indexes the location at the specified resolution, returning the index of the cell containing the location.

Returns 0 (E_SUCCESS) on success.

cellToPoint#

H3Error cellToPoint(H3Index cell, GeoPoint *g);

Finds the centroid of the cell.

Returns 0 (E_SUCCESS) on success.

cellToBoundary#

H3Error cellToBoundary(H3Index cell, CellBoundary *bndry);

Finds the boundary of the cell.

Returns 0 (E_SUCCESS) on success.