Skip to main content
Version: 4.x

Vertex functions

Vertex mode allows encoding the topological vertexes of H3 cells.

cellToVertex

Returns the index for the specified cell vertex. Valid vertex numbers are between 0 and 5 (inclusive) for hexagonal cells, and 0 and 4 (inclusive) for pentagonal cells.

H3Error cellToVertex(H3Index origin, int vertexNum, H3Index *out);

Returns 0 (E_SUCCESS) on success.

cellToVertexes

Returns the indexes for all vertexes of the given cell.

H3Error cellToVertexes(H3Index origin, H3Index *out);

The length of the out array must be 6. If the given cell is a pentagon, one member of the array will be set to 0.

Returns 0 (E_SUCCESS) on success.

vertexToLatLng

Returns the latitude and longitude coordinates of the given vertex.

H3Error vertexToLatLng(H3Index vertex, LatLng *point);

Returns 0 (E_SUCCESS) on success.

isValidVertex

Determines if the given H3 index represents a valid H3 vertex.

int isValidVertex(H3Index vertex);

Returns 1 if the given index represents a valid H3 vertex.