H3 Functions
A range of functions are available to process H3 hexagon indexes in Studio expressions.
| Function | Arguments | Return Type | Description |
|---|---|---|---|
geoToH3() |
real, real, integer |
string |
Indexes the latitude, longitude location at the specified resolution, returning the index of the cell containing the location. Returns 0 on error. |
h3ToLat() |
string |
real |
Returns centroid latitude of cell (as in geoToH3) |
h3ToLng() |
string |
real |
Returns centroid longitude of cell (as in geoToH3) |
h3ToCenterChild() |
string, integer |
string |
Returns the center child (finer) index contained by h at resolution childRes. |
h3ToParent() |
string, integer |
string |
Returns the parent (coarser) index containing h. |
h3IsPentagon() |
string |
boolean |
Returns true if this index represents a pentagonal cell. |
h3IsValid() |
string |
boolean |
Returns true if this is a valid H3 index. |
h3IsResClassIII() |
string |
boolean |
Returns true if this index has a resolution with Class III orientation. |
h3GetBaseCell() |
string |
integer |
Returns the base cell number of the index. |
h3GetResolution() |
string |
integer |
Returns the resolution of the index. |
h3IndexesAreNeighbors() |
string, string |
boolean |
Returns whether or not the provided H3Indexes are neighbors. Returns 1 if the indexes are neighbors, 0 otherwise. |
getH3UnidirectionalEdge() |
string, string |
string |
Returns a unidirectional edge H3 index based on the provided origin and destination. Returns 0 on error. |
getOriginH3Index``FromUnidirectionalEdge() |
string |
string |
Returns the origin hexagon from the unidirectional edge H3Index. |
getDestinationH3Index``FromUnidirectionalEdge() |
string |
string |
Returns the destination hexagon from the unidirectional edge H3Index. |
h3UnidirectionalEdgeIsValid() |
string |
boolean |
Determines if the provided H3Index is a valid unidirectional edge index. |
h3Distance() |
string, string |
integer |
Returns the distance in grid cells between the two indexes. |
experimentalH3ToLocalI() |
string, string |
integer |
Returns a local I coordinate for this cell anchored by an origin. |
experimentalH3ToLocalJ() |
string, string |
integer |
Returns a local J coordinate for this cell anchored by an origin. |
experimentalLocalIjToH3() |
string, integer, integer |
string |
Produces an H3 index from local IJ coordinates anchored by an origin. This function is experimental, and its output is not guaranteed to be compatible across different versions of H3. |
degsToRads() |
real |
real |
Converts degrees to radians. |
radsToDegs() |
real |
real |
Converts radians to degrees. |