SupportLog In

H3 Functions

A range of functions are available to process H3 hexagon indexes in Studio expressions.

FunctionArgumentsReturn TypeDescription
geoToH3()real, real, integerstringIndexes the latitude, longitude location at the specified resolution, returning the index of the cell containing the location. Returns 0 on error.
h3ToLat()stringrealReturns centroid latitude of cell (as in geoToH3)
h3ToLng()stringrealReturns centroid longitude of cell (as in geoToH3)
h3ToCenterChild()string, integerstringReturns the center child (finer) index contained by h at resolution childRes.
h3ToParent()string, integerstringReturns the parent (coarser) index containing h.
h3IsPentagon()stringbooleanReturns true if this index represents a pentagonal cell.
h3IsValid()stringbooleanReturns true if this is a valid H3 index.
h3IsResClassIII()stringbooleanReturns true if this index has a resolution with Class III orientation.
h3GetBaseCell()stringintegerReturns the base cell number of the index.
h3GetResolution()stringintegerReturns the resolution of the index.
h3IndexesAreNeighbors()string, stringbooleanReturns whether or not the provided H3Indexes are neighbors. Returns 1 if the indexes are neighbors, 0 otherwise.
getH3UnidirectionalEdge()string, stringstringReturns a unidirectional edge H3 index based on the provided origin and destination. Returns 0 on error.
getOriginH3Index FromUnidirectionalEdge()stringstringReturns the origin hexagon from the unidirectional edge H3Index.
getDestinationH3Index FromUnidirectionalEdge()stringstringReturns the destination hexagon from the unidirectional edge H3Index.
h3UnidirectionalEdgeIsValid()stringbooleanDetermines if the provided H3Index is a valid unidirectional edge index.
h3Distance()string, stringintegerReturns the distance in grid cells between the two indexes.
experimentalH3ToLocalI()string, stringintegerReturns a local I coordinate for this cell anchored by an origin.
experimentalH3ToLocalJ()string, stringintegerReturns a local J coordinate for this cell anchored by an origin.
experimentalLocalIjToH3()string, integer, integerstringProduces 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()realrealConverts degrees to radians.
radsToDegs()realrealConverts radians to degrees.