Vertex functions
Vertex mode allows encoding the topological vertexes of H3 cells.
cellToVertex
- C
- Python
- Java
- JavaScript (Live)
H3Error cellToVertex(H3Index origin, int vertexNum, H3Index *out);
h3.cell_to_vertex(origin, vertex_num)
Long cellToVertex(long origin, int vertexNum);
String cellToVertex(String origin, int vertexNum);
h3.cellToVertex(origin, vertexNum)
Live Editor
Result
Loading...
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.
cellToVertexes
- C
- Python
- Java
- JavaScript (Live)
H3Error cellToVertexes(H3Index origin, H3Index *out);
h3.cell_to_vertexes(origin)
List<Long> cellToVertexes(long origin);
List<String> cellToVertexes(String origin);
h3.cellToVertexes(origin)
Live Editor
Result
Loading...
Returns the indexes for all vertexes of the given cell index.
The length of the out
array must be 6. If the given cell index represents a pentagon, one member of the
array will be set to 0
.
vertexToLatLng
- C
- Python
- Java
- JavaScript (Live)
H3Error vertexToLatLng(H3Index vertex, LatLng *point);
h3.vertex_to_latlng(vertex)
LatLng vertexToLatLng(long vertex);
LatLng vertexToLatLng(String vertex);
h3.vertexToLatLng(vertex)
Live Editor
Result
Loading...
Returns the latitude and longitude coordinates of the given vertex.
isValidVertex
- C
- Python
- Java
- JavaScript (Live)
int isValidVertex(H3Index vertex);
h3.is_valid_vertex(vertex)
boolean isValidVertex(long vertex);
boolean isValidVertex(String vertex);
h3.isValidVertex(vertex)
Live Editor
Result
Loading...
Returns 1 if the given index represents a valid H3 vertex.