Skip to main content
Version: 4.x

Function name changes

The following function and structure names changed from 3.x to 4.0.0:

General Function Names

3.x name.4.0.0 name
Does Not Exist (DNE)isValidIndex
h3IsValidisValidCell
h3UnidirectionalEdgeIsValidisValidDirectedEdge
h3IsPentagonisPentagon
h3IsResClassIIIisResClassIII
h3IndexesAreNeighborsareNeighborCells
h3ToParentcellToParent
h3ToCenterChildcellToCenterChild
h3ToChildrencellToChildren
numHexagonsgetNumCells
getRes0IndexesgetRes0Cells
getPentagonIndexesgetPentagons
h3GetBaseCellgetBaseCellNumber
h3GetResolutiongetResolution
DNEgetMode
h3GetFacesgetIcosahedronFaces
geoToH3latLngToCell
h3ToGeocellToLatLng
compactcompactCells
uncompactuncompactCells
polyfillpolygonToCells

Note: getResolution and getBaseCellNumber should work for both cells and edges.

H3 Grid Functions

Many of these functions will have three forms:

  • <func_name>
  • <func_name>Unsafe
  • <func_name>Safe

The Unsafe version is fast, but may fail if it encounters a pentagon. It should return a failure code in this case.

The Safe version is slower, but will work in all cases.

The version without either suffix is intended to be the one typically used. This version will first attempt the Unsafe version, and if it detects failure, will fall back to the Safe version. Encountering pentagons is rare in most use-cases, so this version should usually be equivalent to the fast version, but with a guarantee that it will not fail.

Initially, we will not expose the Safe versions to users in the API. We may expose them in the future if a need becomes clear.

Distance

3.x name.4.0.0 name
h3DistancegridDistance
h3LinegridPathCells
DNEgridPathEdges
DNEgridPathDirectedEdges

Filled-In Disk With Distances

3.x name.4.0.0 nameCalls
hexRangeDistancesgridDiskDistancesUnsafeNONE
_kRingInternalgridDiskDistancesSafeNONE
kRingDistancesgridDiskDistanceshexRangeDistances, _kRingInternal

Filled-In Disk Without Distances

3.x name.4.0.0 nameCalls
hexRangegridDiskUnsafehexRangeDistances
DNEgridDiskSafe
kRinggridDiskkRingDistances
hexRangesgridDisksUnsafeN x hexRange

Hollow Ring

3.x name.4.0.0 nameCalls
hexRinggridRingUnsafeNONE
DNEgridRingSafegridDiskDistancesSafe
DNEgridRinggridRingUnsafe, gridRingSafe

Local IJ

3.x name4.0.0 name
experimentalLocalIjToH3localIjToCell
experimentalH3ToLocalIjcellToLocalIj

H3 Edge Types

Instead of UnidirectionalEdge, use the term DirectedEdge.

For a future undirected edge mode, use the term Edge.

3.x name.4.0.0 name
h3UnidirectionalEdgeIsValidisValidDirectedEdge
getH3UnidirectionalEdgecellsToDirectedEdge
getH3IndexesFromUnidirectionalEdgedirectedEdgeToCells
getH3UnidirectionalEdgesFromHexagonoriginToDirectedEdges
DNEdestinationToDirectedEdges
getH3UnidirectionalEdgeBoundarydirectedEdgeToBoundary
getOriginH3IndexFromUnidirectionalEdgegetDirectedEdgeOrigin
getDestinationH3IndexFromUnidirectionalEdgegetDirectedEdgeDestination

Area/Length Functions

3.x name.4.0.0 name
hexAreaKm2getHexagonAreaAvgKm2
hexAreaM2getHexagonAreaAvgM2
edgeLengthKmgetHexagonEdgeLengthAvgKm
edgeLengthMgetHexagonEdgeLengthAvgM
DNEgetPentagonAreaAvg*
DNEgetPentagonEdgeLengthAvg*
DNEcellAreaKm2
DNEcellAreaM2
pointDistKmgreatCircleDistanceKm
pointDistMgreatCircleDistanceM
pointDistRadsgreatCircleDistanceRads
exactEdgeLengthRadsedgeLengthRads
exactEdgeLengthKmedgeLengthKm
exactEdgeLengthMedgeLengthM

Note: cellAreaKm2 and cellAreaM2 would return the actual area of the passed-in cell.

Polygons

Data Structures

  • rename GeoBoundary to CellBoundary to indicate it is space-limited to describing the geometry of cells
3.x name4.0.0 nameNotes
GeoBoundaryCellBoundary<= 10 stack-allocated LatLngs
GeoCoordLatLng
GeofenceGeoLoopheap-allocated LatLngs
GeoPolygonGeoPolygon
GeoMultiPolygonGeoMultiPolygoncurrently not used

Functions

3.x name4.0.0 nameNotes
h3ToGeoBoundarycellToBoundaryreturns CellBoundary
DNEcellToLoopreturns GeoLoop
DNEloopToBoundary
DNEboundaryToLoop
getH3UnidirectionalEdgeBoundarydirectedEdgeToBoundaryreturns CellBoundary
h3SetToLinkedGeocellsToLinkedMultiPolygonreturns LinkedGeoPolygon
h3SetToMultiPolygoncellsToMultiPolygonbindings only