H3 class abstract

Provides access to H3 functions.

Implementers

Constructors

H3.new()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

areNeighborCells(BigInt origin, BigInt destination) bool
Determines whether or not the provided H3 cells are neighbors.
cellArea(BigInt h3Index, H3Units unit) double
Calculates exact area of a given cell in square units (e.g. m^2)
cellsToDirectedEdge(BigInt origin, BigInt destination) BigInt
Provides a directed edge H3 index based on the provided origin and destination.
cellsToMultiPolygon(List<BigInt> h3Set) List<Polygon>
Create a GeoJSON-like multi-polygon describing the outline(s) of a set of cells. Polygon outlines will follow GeoJSON MultiPolygon order: Each polygon will have one outer loop, which is first in the list, followed by any holes.
cellToBoundary(BigInt h3Index) List<LatLng>
Gives the cell boundary in lat/lng coordinates for the cell with index h3Index
cellToCenterChild(BigInt h3Index, int resolution) BigInt
Get the center child of the given h3Index hexagon at a particular resolution
cellToChildPos(BigInt child, int parentRes) int
Provides the position of the child cell within an ordered list of all children of the cell's parent at the specified resolution parentRes. The order of the ordered list is the same as that returned by cellToChildren.
cellToChildren(BigInt h3Index, int resolution) List<BigInt>
Get the children/descendents of the given h3Index hexagon at a particular resolution
cellToLatLng(BigInt h3Index) LatLng
Gives the Coordinates LatLng based on the center of the given cell
cellToLocalIj(BigInt origin, BigInt destination) CoordIJ
Produces IJ coordinates for an H3 cell anchored by an origin.
cellToParent(BigInt h3Index, int resolution) BigInt
Get the parent of the given h3Index hexagon at a particular resolution
cellToVertex(BigInt origin, int vertexNum) BigInt
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(BigInt origin) List<BigInt>
Returns the indexes for all vertexes of the given cell.
childPosToCell(int childPos, BigInt parent, int childRes) BigInt
It gives the Child Cell from the Parent Cell using the Resolution childRes and childPos Index in that Child Resolution
compactCells(List<BigInt> hexagons) List<BigInt>
Compact a set of H3 Cells of the same resolution into a set of H3 Cells across multiple levels that represents the same area. Note: Input cells must all share the same resolution
degsToRads(double val) double
Converts degrees to radians
describeH3Error(int err) String
Provides a Error Message from the H3Error Codes 0-15
directedEdgeToBoundary(BigInt edgeIndex) List<LatLng>
Get the vertices of a given edge as an array of lat, lng points. Note that for edges that cross the edge of an icosahedron face, this may return 3 coordinates.
directedEdgeToCells(BigInt edgeIndex) List<BigInt>
Get the origin, destination pair represented by a directed edge
edgeLength(BigInt edgeIndex, H3Units unit) double
Calculates exact length of a given unidirectional edge in units
getBaseCellNumber(BigInt h3Index) int
Returns the base cell "number" (0 to 121) of the provided H3 cell
getDirectedEdgeDestination(BigInt edgeIndex) BigInt
Provides the destination hexagon from the directed edge H3Index.
getDirectedEdgeOrigin(BigInt edgeIndex) BigInt
Provides the origin hexagon from the directed edge H3Index.
getHexagonAreaAvg(int res, H3AreaUnits unit) double
Calculates average hexagon area at a given resolution in units
getHexagonEdgeLengthAvg(int res, H3EdgeLengthUnits unit) double
Calculates average hexagon edge length at a given resolution in units
getIcosahedronFaces(BigInt h3Index) List<int>
Find all icosahedron faces intersected by a given H3 index
getNumCells(int res) int
Returns the total count of hexagons in the world at a given resolution.
getPentagons(int res) List<BigInt>
Get the twelve pentagon indexes at a given resolution.
getRes0Cells() List<BigInt>
Returns all H3 indexes at resolution 0. As every index at every resolution > 0 is the descendant of a res 0 index, this can be used with cellToChildren to iterate over H3 indexes at any resolution.
getResolution(BigInt h3Index) int
Returns the resolution of the index.
greatCircleDistance(LatLng a, LatLng b, H3Units unit) double
Calculates great circle or haversine distance between two geo points.
gridDisk(BigInt h3Index, int ringSize) List<BigInt>
Produces the "filled-in disk" of cells which are at most grid distance k from the origin cell. This includes the origin cell itself.
gridDistance(BigInt origin, BigInt destination) int
Provides the grid distance between two cells, which is defined as the minimum number of "hops" needed across adjacent cells to get from one cell to the other.
gridPathCells(BigInt origin, BigInt destination) List<BigInt>
Given two H3 indexes, return the line of indexes between them (inclusive).
gridRingUnsafe(BigInt h3Index, int ringSize) List<BigInt>
Produces the "How Ring" of cells which are at most grid distance k from the origin cell. This includes the origin cell itself.
h3ToString(BigInt h3) String
Converts the H3Index representation of the index to the string representation
isPentagon(BigInt h3Index) bool
Determines if h3Index is a valid pentagon
isResClassIII(BigInt h3Index) bool
Determines if h3Index Resolution is Class III (Rotated ~19.1 deg or not)
isValidCell(BigInt h3Index) bool
Determines if h3Index is a valid cell (hexagon or pentagon)
isValidDirectedEdge(BigInt edgeIndex) bool
Determines if the provided H3Index is a valid directed edge index
isValidVertex(BigInt h3Index) bool
Determines if the given H3 index represents a valid H3 vertex.
latLngToCell(LatLng latLng, int res) BigInt
Finds the Cell based on the latLng coordinates at the specified resolution level res
localIjToCell(BigInt origin, CoordIJ coordinates) BigInt
Produces an H3 cell for IJ coordinates anchored by an origin.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
originToDirectedEdges(BigInt edgeIndex) List<BigInt>
Provides all of the directed edges from the current cell. (i.e. an edge to every neighbor)
polygonToCells({required List<LatLng> coordinates, required int resolution, List<List<LatLng>> holes}) List<BigInt>
Takes a given coordinates and resolution and returns hexagons that are contained by them.
polygonToCellsExperimental({required List<LatLng> coordinates, required int resolution, List<List<LatLng>> holes = const [], required int flags}) List<BigInt>
takes as input a GeoJSON-like data structure describing a polygon (i.e., an outer ring and optional holes) and a target cell resolution. It produces a collection of cells that are contained within the polygon.
radsToDegs(double val) double
Converts radians to degrees
stringToH3(String h3Str) BigInt
Converts the string representation to H3Index (uint64_t) representation.
toString() String
A string representation of this object.
inherited
uncompactCells(List<BigInt> compactedHexagons, {required int resolution}) List<BigInt>
Uncompact a compacted set of hexagons to hexagons of the same resolution
vertexToLatLng(BigInt vertex) LatLng
Returns the latitude and longitude coordinates of the given vertex

Operators

operator ==(Object other) bool
The equality operator.
inherited