Miscellaneous H3 functions
These functions include descriptions of the H3 grid system.
degsToRads
- C
- Python
- Java
- JavaScript (Live)
double degsToRads(double degrees);
Use math.radians(degrees)
instead.
Use java.lang.Math.toRadians(double degrees)
instead.
h3.degsToRads(degrees)
Converts degrees to radians.
radsToDegs
- C
- Python
- Java
- JavaScript (Live)
double radsToDegs(double radians);
Use math.degrees(radians)
instead.
Use java.lang.Math.toDegrees(double radians)
instead.
h3.radsToDegs(h)
Converts radians to degrees.
hexAreaKm2
- C
- Python
- Java
- JavaScript (Live)
double hexAreaKm2(int res);
h3.hex_area(res, unit='km^2')
double hexArea(int res, AreaUnit unit);
h3.hexArea(res, h3.UNITS.km2)
Average hexagon area in square kilometers at the given resolution.
hexAreaM2
- C
- Python
- Java
- JavaScript (Live)
double hexAreaM2(int res);
h3.hex_area(res, unit='m^2')
double hexArea(int res, AreaUnit unit);
h3.hexArea(res, h3.UNITS.m2)
Average hexagon area in square meters at the given resolution.
cellAreaM2
- C
- Python
- Java
- JavaScript (Live)
double cellAreaM2(H3Index h);
h3.cell_area(h, unit='m^2')
double cellArea(long h3, AreaUnit unit);
int cellArea(String h3Address, AreaUnit unit);
h3.cellArea(h, h3.UNITS.m2)
Exact area of specific cell in square meters.
cellAreaRads2
- C
- Python
- Java
- JavaScript (Live)
double cellAreaRads2(H3Index h);
h3.cell_area(h, unit='rads^2')
double cellArea(long h3, AreaUnit unit);
int cellArea(String h3Address, AreaUnit unit);
h3.cellArea(h, h3.UNITS.rads2)
Exact area of specific cell in square radians.
edgeLengthKm
- C
- Python
- Java
- JavaScript (Live)
double edgeLengthKm(int res);
h3.edge_length(res, unit='km')
double edgeLength(int res, LengthUnit unit);
h3.edgeLength(res, h3.UNITS.km)
Average hexagon edge length in kilometers at the given resolution.
edgeLengthM
- C
- Python
- Java
- JavaScript (Live)
double edgeLengthM(int res);
h3.edge_length(res, unit='m')
double edgeLength(int res, LengthUnit unit);
h3.edgeLength(res, h3.UNITS.m)
Average hexagon edge length in meters at the given resolution.
exactEdgeLengthKm
- C
- Python
- Java
- JavaScript (Live)
double exactEdgeLengthKm(H3Index edge);
h3.exact_edge_length(h, unit='km')
double exactEdgeLength(long h3, LengthUnit unit);
double exactEdgeLength(String h3Address, LengthUnit unit);
h3.exactEdgeLength(h3, h3.UNITS.km)
Exact edge length of specific unidirectional edge in kilometers.
exactEdgeLengthM
- C
- Python
- Java
- JavaScript (Live)
double exactEdgeLengthM(H3Index edge);
h3.exact_edge_length(h, unit='m')
double exactEdgeLength(long h3, LengthUnit unit);
double exactEdgeLength(String h3Address, LengthUnit unit);
h3.exactEdgeLength(h3, h3.UNITS.m)
Exact edge length of specific unidirectional edge in meters.
exactEdgeLengthRads
- C
- Python
- Java
- JavaScript (Live)
double exactEdgeLengthRads(H3Index edge);
h3.exact_edge_length(h, unit='rads')
double exactEdgeLength(long h3, LengthUnit unit);
double exactEdgeLength(String h3Address, LengthUnit unit);
h3.exactEdgeLength(h3, h3.UNITS.rads)
Exact edge length of specific unidirectional edge in radians.
numHexagons
- C
- Python
- Java
- JavaScript (Live)
int64_t numHexagons(int res);
h3.num_hexagons(res)
long numHexagons(int res);
h3.numHexagons(res)
Number of unique H3 indexes at the given resolution.
getRes0Indexes
- C
- Python
- Java
- JavaScript (Live)
void getRes0Indexes(H3Index *out);
h3.get_res0_indexes(res)
Collection<Long> getRes0Indexes(int res);
Collection<String> getRes0IndexesAddresses(int res);
h3.getRes0Indexes(res)
All the resolution 0 H3 indexes.
out
must be an array of at least size res0IndexCount()
.
res0IndexCount
- C
- Python
- Java
- JavaScript (Live)
int res0IndexCount(void);
This function exists for memory management and is not exposed.
This function exists for memory management and is not exposed.
This function exists for memory management and is not exposed.
Number of resolution 0 H3 indexes.
getPentagonIndexes
- C
- Python
- Java
- JavaScript (Live)
void getPentagonIndexes(int res, H3Index *out);
h3.get_pentagon_indexes(res)
Collection<Long> getPentagonIndexes(int res);
Collection<String> getPentagonIndexesAddresses(int res);
h3.getPentagonIndexes(res)
All the pentagon H3 indexes at the specified resolution.
out
must be an array of at least size pentagonIndexCount()
.
pentagonIndexCount
- C
- Python
- Java
- JavaScript (Live)
int pentagonIndexCount(void);
This function exists for memory management and is not exposed.
This function exists for memory management and is not exposed.
This function exists for memory management and is not exposed.
Number of pentagon H3 indexes per resolution. This is always 12, but provided as a convenience.
pointDistKm
- C
- Python
- Java
- JavaScript (Live)
double pointDistKm(const GeoCoord *a, const GeoCoord *b);
h3.point_dist(point1, point2, unit='km')
double pointDist(GeoCoord point1, GeoCoord point2, LengthUnit unit);
h3.pointDist(point1, point2, h3.UNITS.km)
Gives the "great circle" or "haversine" distance between pairs of GeoCoord points (lat/lng pairs) in kilometers.
pointDistM
- C
- Python
- Java
- JavaScript (Live)
double pointDistM(const GeoCoord *a, const GeoCoord *b);
h3.point_dist(point1, point2, unit='m')
double pointDist(GeoCoord point1, GeoCoord point2, LengthUnit unit);
h3.pointDist(point1, point2, h3.UNITS.m)
Gives the "great circle" or "haversine" distance between pairs of GeoCoord points (lat/lng pairs) in meters.
pointDistRads
- C
- Python
- Java
- JavaScript (Live)
double pointDistRads(const GeoCoord *a, const GeoCoord *b);
h3.point_dist(point1, point2, unit='rads')
double pointDist(GeoCoord point1, GeoCoord point2, LengthUnit unit);
h3.pointDist(point1, point2, h3.UNITS.rads)
Gives the "great circle" or "haversine" distance between pairs of GeoCoord points (lat/lng pairs) in radians.