Expand description
Low-level bindings to H3
This crate includes the C sources for libh3, so compiling it requires a C toolchain.
Modules§
Structs§
- Cell
Boundary - @struct CellBoundary @brief cell boundary in latitude/longitude
- CoordIJ
- @struct CoordIJ @brief IJ hexagon coordinates
- GeoLoop
- @struct GeoLoop @brief similar to CellBoundary, but requires more alloc work
- GeoMulti
Polygon - @struct GeoMultiPolygon @brief Simplified core of GeoJSON MultiPolygon coordinates definition
- GeoPolygon
- @struct GeoPolygon @brief Simplified core of GeoJSON Polygon coordinates definition
- LatLng
- @struct LatLng @brief latitude/longitude in radians
- Linked
GeoLoop - Linked
GeoPolygon - Linked
LatLng
Functions§
- areNeighbor
Cells ⚠ - @defgroup areNeighborCells areNeighborCells Functions for areNeighborCells @{ / /** @brief returns whether or not the provided hexagons border
- cell
Area ⚠Km2 - @brief exact area for a specific cell (hexagon or pentagon) in kilometers^2
- cell
Area ⚠M2 - @brief exact area for a specific cell (hexagon or pentagon) in meters^2
- cell
Area ⚠Rads2 - @defgroup cellArea cellArea Functions for cellArea @{ / /** @brief exact area for a specific cell (hexagon or pentagon) in radians^2
- cell
ToBoundary ⚠ - @defgroup cellToBoundary cellToBoundary Functions for cellToBoundary @{ / /** @brief give the cell boundary in lat/lng coordinates for the cell h3
- cell
ToCenter ⚠Child - @defgroup cellToCenterChild cellToCenterChild Functions for cellToCenterChild @{ / /** @brief returns the center child of the given cell at the specified resolution
- cell
ToChild ⚠Pos - @defgroup cellToChildPos cellToChildPos Functions for cellToChildPos @{ / /** @brief Returns the position of the cell within an ordered list of all children of the cell’s parent at the specified resolution
- cell
ToChildren ⚠ - @brief provides the children (or grandchildren, etc) of the given cell
- cell
ToChildren ⚠Size - @defgroup cellToChildren cellToChildren Functions for cellToChildren @{ / /** @brief determines the exact number of children (or grandchildren, etc) that would be returned for the given cell
- cell
ToLat ⚠Lng - @defgroup cellToLatLng cellToLatLng Functions for cellToLatLng @{ / /** @brief find the lat/lng center point g of the cell h3
- cell
ToLocal ⚠Ij - @defgroup cellToLocalIj cellToLocalIj Functions for cellToLocalIj @{ / /** @brief Returns two dimensional coordinates for the given index
- cell
ToParent ⚠ - @defgroup cellToParent cellToParent Functions for cellToParent @{ / /** @brief returns the parent (or grandparent, etc) cell of the given cell
- cell
ToVertex ⚠ - @defgroup cellToVertex cellToVertex Functions for cellToVertex @{ / /** @brief Returns a single vertex for a given cell, as an H3 index
- cell
ToVertexes ⚠ - @defgroup cellToVertexes cellToVertexes Functions for cellToVertexes @{ / /** @brief Returns all vertexes for a given cell, as H3 indexes
- cells
ToDirected ⚠Edge - @defgroup cellsToDirectedEdge cellsToDirectedEdge Functions for cellsToDirectedEdge @{ / /** @brief returns the directed edge H3Index for the specified origin and destination
- cells
ToLinked ⚠Multi Polygon - @defgroup cellsToMultiPolygon cellsToMultiPolygon Functions for cellsToMultiPolygon (currently a binding-only concept) @{ / /** @brief Create a LinkedGeoPolygon from a set of contiguous hexagons
- child
PosTo ⚠Cell - @defgroup childPosToCell childPosToCell Functions for childPosToCell @{ / /** @brief Returns the child cell at a given position within an ordered list of all children at the specified resolution
- compact
Cells ⚠ - @defgroup compactCells compactCells Functions for compactCells @{ / /** @brief compacts the given set of hexagons as best as possible
- degs
ToRads ⚠ - @defgroup degsToRads degsToRads Functions for degsToRads @{ / /** @brief converts degrees to radians
- destroy
Linked ⚠Multi Polygon - @brief Free all memory created for a LinkedGeoPolygon
- directed
Edge ⚠ToBoundary - @defgroup directedEdgeToBoundary directedEdgeToBoundary Functions for directedEdgeToBoundary @{ / /** @brief Returns the CellBoundary containing the coordinates of the edge
- directed
Edge ⚠ToCells - @defgroup directedEdgeToCells
directedEdgeToCells Functions for directedEdgeToCells @{ / /** @brief Returns the origin and destination hexagons from the directed edge H3Index - edge
Length ⚠Km - @brief exact length for a specific directed edge in kilometers
- edge
LengthM ⚠ - @brief exact length for a specific directed edge in meters
- edge
Length ⚠Rads - @defgroup edgeLength edgeLength Functions for edgeLength @{ / /** @brief exact length for a specific directed edge in radians
- getBase
Cell ⚠Number - @defgroup getBaseCellNumber getBaseCellNumber Functions for getBaseCellNumber @{ / /** @brief returns the base cell “number” (0 to 121) of the provided H3 cell
- getDirected
Edge ⚠Destination - @defgroup getDirectedEdgeDestination
getDirectedEdgeDestination Functions for getDirectedEdgeDestination @{ / /** @brief Returns the destination hexagon H3Index from the directed edge H3Index - getDirected
Edge ⚠Origin - @defgroup getDirectedEdgeOrigin
getDirectedEdgeOrigin Functions for getDirectedEdgeOrigin @{ / /** @brief Returns the origin hexagon H3Index from the directed edge H3Index - getHexagon
Area ⚠AvgKm2 - @defgroup getHexagonAreaAvg getHexagonAreaAvg Functions for getHexagonAreaAvg @{ / /** @brief average hexagon area in square kilometers (excludes pentagons)
- getHexagon
Area ⚠AvgM2 - @brief average hexagon area in square meters (excludes pentagons)
- getHexagon
Edge ⚠Length AvgKm - @defgroup getHexagonEdgeLengthAvg getHexagonEdgeLengthAvg Functions for getHexagonEdgeLengthAvg @{ / /** @brief average hexagon edge length in kilometers (excludes pentagons)
- getHexagon
Edge ⚠Length AvgM - @brief average hexagon edge length in meters (excludes pentagons)
- getIcosahedron
Faces ⚠ - @brief Find all icosahedron faces intersected by a given H3 index
- getNum
Cells ⚠ - @defgroup getNumCells getNumCells Functions for getNumCells @{ / /** @brief number of cells (hexagons and pentagons) for a given resolution
- getPentagons⚠
- @brief generates all pentagons at the specified resolution
- getRes0
Cells ⚠ - @brief provides all base cells in H3Index format
- getResolution⚠
- @defgroup getResolution getResolution Functions for getResolution @{ / /** @brief returns the resolution of the provided H3 index Works on both cells and directed edges.
- great
Circle ⚠Distance Km - @brief “great circle distance” between pairs of LatLng points in kilometers
- great
Circle ⚠DistanceM - @brief “great circle distance” between pairs of LatLng points in meters
- great
Circle ⚠Distance Rads - @defgroup greatCircleDistance greatCircleDistance Functions for distance @{ / /** @brief “great circle distance” between pairs of LatLng points in radians
- grid
Disk ⚠ - @brief hexagon neighbors in all directions
- grid
Disk ⚠Distances - @defgroup gridDiskDistances gridDiskDistances Functions for gridDiskDistances @{ / /** @brief hexagon neighbors in all directions, reporting distance from origin
- grid
Disk ⚠Distances Safe - @brief hexagons neighbors in all directions reporting distance from origin
- grid
Disk ⚠Distances Unsafe - @brief hexagons neighbors in all directions, assuming no pentagons, reporting distance from origin
- grid
Disk ⚠Unsafe - @brief hexagons neighbors in all directions, assuming no pentagons
- grid
Disks ⚠Unsafe - @brief collection of hex rings sorted by ring for all given hexagons
- grid
Distance ⚠ - @defgroup gridDistance gridDistance Functions for gridDistance @{ / /** @brief Returns grid distance between two indexes
- grid
Path ⚠Cells - @brief Line of h3 indexes connecting two indexes
- grid
Path ⚠Cells Size - @defgroup gridPathCells gridPathCells Functions for gridPathCells @{ / /** @brief Number of indexes in a line connecting two indexes
- grid
Ring ⚠Unsafe - @defgroup gridRingUnsafe gridRingUnsafe Functions for gridRingUnsafe @{ / /** @brief hollow hexagon ring at some origin
- h3To
String ⚠ - @defgroup h3ToString h3ToString Functions for h3ToString @{ / /** @brief converts an H3Index to a canonical string
- isPentagon⚠
- @defgroup isPentagon isPentagon Functions for isPentagon @{ / /** @brief determines if an H3 cell is a pentagon
- isRes
ClassIII ⚠ - @defgroup isResClassIII isResClassIII Functions for isResClassIII @{ / /** @brief determines if a hexagon is Class III (or Class II)
- isValid
Cell ⚠ - @defgroup isValidCell isValidCell Functions for isValidCell @{ / /** @brief confirms if an H3Index is a valid cell (hexagon or pentagon) In particular, returns 0 (False) for H3 directed edges or invalid data
- isValid
Directed ⚠Edge - @defgroup isValidDirectedEdge isValidDirectedEdge Functions for isValidDirectedEdge @{ / /** @brief returns whether the H3Index is a valid directed edge
- isValid
Vertex ⚠ - @defgroup isValidVertex isValidVertex Functions for isValidVertex @{ / /** @brief Whether the input is a valid H3 vertex
- latLng
ToCell ⚠ - @defgroup latLngToCell latLngToCell Functions for latLngToCell @{ / /** @brief find the H3 index of the resolution res cell containing the lat/lng
- local
IjTo ⚠Cell - @defgroup localIjToCell localIjToCell Functions for localIjToCell @{ / /** @brief Returns index for the given two dimensional coordinates
- maxFace
Count ⚠ - @defgroup getIcosahedronFaces getIcosahedronFaces Functions for getIcosahedronFaces @{ / /** @brief Max number of icosahedron faces intersected by an index
- maxGrid
Disk ⚠Size - @defgroup gridDisk gridDisk Functions for gridDisk @{ / /** @brief maximum number of hexagons in k-ring
- maxPolygon
ToCells ⚠Size - @defgroup polygonToCells polygonToCells Functions for polygonToCells @{ / /** @brief maximum number of hexagons that could be in the geoloop
- origin
ToDirected ⚠Edges - @defgroup originToDirectedEdges
originToDirectedEdges Functions for originToDirectedEdges @{ / /** @brief Returns the 6 (or 5 for pentagons) edges associated with the H3Index - pentagon
Count ⚠ - @defgroup getPentagons getPentagons Functions for getPentagons @{ / /** @brief returns the number of pentagons per resolution
- polygon
ToCells ⚠ - @brief hexagons within the given geopolygon
- rads
ToDegs ⚠ - @defgroup radsToDegs radsToDegs Functions for radsToDegs @{ / /** @brief converts radians to degrees
- res0
Cell ⚠Count - @defgroup getRes0Cells getRes0Cells Functions for getRes0Cells @{ / /** @brief returns the number of resolution 0 cells (hexagons and pentagons)
- string
ToH3 ⚠ - @defgroup stringToH3 stringToH3 Functions for stringToH3 @{ / /** @brief converts the canonical string format to H3Index format
- uncompact
Cells ⚠ - @brief uncompacts the compacted hexagon set
- uncompact
Cells ⚠Size - @defgroup uncompactCells uncompactCells Functions for uncompactCells @{ / /** @brief determines the exact number of hexagons that will be uncompacted from the compacted set
- vertex
ToLat ⚠Lng - @defgroup vertexToLatLng vertexToLatLng Functions for vertexToLatLng @{ / /** @brief Returns a single vertex for a given cell, as an H3 index