Module h3

Data Types

coord()

coord() = {float(), float()}

h3index()

h3index() = non_neg_integer()

resolution()

resolution() = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15

Function Index

children/2Returns the children container by the given Index at the given child resolution ChildRes.
compact/1Compacts the given list of indexes as best as possible.
edge_length_kilometers/1
edge_length_meters/1
from_geo/2Indexes the location at the specified resolution.
from_string/1Converts the string representation to an index.
get_base_cell/1Returns the base cell number of the index.
get_resolution/1Returns the resolution of the index.
get_unidirectional_edge/2Returns a unidirectiol edge based on the given origin and destination.
grid_distance/2Returns the distance in grid cells between the two indexes.
hex_area_km2/1
hex_area_m2/1
indices_are_neighbors/2
is_class3/1Returns whether the given index has a resolution with Class III orientation.
is_pentagon/1Returns whether the given index represents a pentagonal cell.
is_valid/1Returns whethr the given index is valid.
k_ring/2Produces indices within the given distance K from the given origin Index.
k_ring_distances/2Produces indices and the associated distance within the given distance K from the given origin Index.
max_k_ring_size/1Returns the maximum number of indices that result from the k-ring algorithm with the given K.
num_hexagons/1
parent/2Returns the parent (coarser) index containing the given Index.
to_geo/1Finds the centroid of the index.
to_geo_boundary/1Finds the geo boundary of the given index.
to_string/1Converts the given index to its string representation.
uncompact/2Uncompacts given list of indexes to the given resolution.

Function Details

children/2

children(Index::h3index(), ChildRes::resolution()) -> [h3index(), ...]

Returns the children container by the given Index at the given child resolution ChildRes.

compact/1

compact(X1::[h3index(), ...]) -> [h3index(), ...]

Compacts the given list of indexes as best as possible. Returns a list of at most the same length as the input list.

edge_length_kilometers/1

edge_length_kilometers(X1::resolution()) -> float()

edge_length_meters/1

edge_length_meters(X1::resolution()) -> float()

from_geo/2

from_geo(X1::coord(), X2::resolution()) -> h3index()

Indexes the location at the specified resolution. Takes the coordinate in degrees.

from_string/1

from_string(X1::string()) -> h3index()

Converts the string representation to an index.

get_base_cell/1

get_base_cell(X1::h3index()) -> h3index()

Returns the base cell number of the index.

get_resolution/1

get_resolution(X1::h3index()) -> resolution()

Returns the resolution of the index.

get_unidirectional_edge/2

get_unidirectional_edge(Origin::h3index(), Destination::h3index()) -> Edge::h3index()

Returns a unidirectiol edge based on the given origin and destination.

grid_distance/2

grid_distance(X1::h3index(), X2::h3index()) -> integer()

Returns the distance in grid cells between the two indexes. Throws a badarg if the distance can not be found. Finding the distance can fail because the two indexes are not comparable (different resolutions), too far apart, or are separated by pentagonal distortion.

hex_area_km2/1

hex_area_km2(X1::non_neg_integer()) -> float()

hex_area_m2/1

hex_area_m2(X1::non_neg_integer()) -> float()

indices_are_neighbors/2

indices_are_neighbors(X1::h3index(), X2::h3index()) -> boolean()

is_class3/1

is_class3(X1::h3index()) -> boolean()

Returns whether the given index has a resolution with Class III orientation.

is_pentagon/1

is_pentagon(X1::h3index()) -> boolean()

Returns whether the given index represents a pentagonal cell.

is_valid/1

is_valid(X1::h3index()) -> boolean()

Returns whethr the given index is valid.

k_ring/2

k_ring(Index::h3index(), K::non_neg_integer()) -> [h3index(), ...]

Produces indices within the given distance K from the given origin Index. k-ring 0 is defined as the origin index, k-ring 1 is defined as k-ring 0 and all neighboring indices, and so on. Output is returned in no particular order.

k_ring_distances/2

k_ring_distances(Index::h3index(), K::non_neg_integer()) -> [{h3index(), non_neg_integer()}, ...]

Produces indices and the associated distance within the given distance K from the given origin Index. k-ring 0 is defined as the origin index, k-ring 1 is defined as k-ring 0 and all neighboring indices, and so on. Output is returned in no particular order.

max_k_ring_size/1

max_k_ring_size(K::non_neg_integer()) -> non_neg_integer()

Returns the maximum number of indices that result from the k-ring algorithm with the given K.

num_hexagons/1

num_hexagons(X1::resolution()) -> pos_integer()

parent/2

parent(Index::h3index(), ParentRes::resolution()) -> h3index()

Returns the parent (coarser) index containing the given Index. Requests for higher resolutions than the the resolution of Index are an error.

to_geo/1

to_geo(X1::h3index()) -> coord()

Finds the centroid of the index. Returns the coordinate in degrees.

to_geo_boundary/1

to_geo_boundary(X1::h3index()) -> [coord()]

Finds the geo boundary of the given index. The retuurned list of coordinates is in degrees.

to_string/1

to_string(X1::h3index()) -> string()

Converts the given index to its string representation.

uncompact/2

uncompact(X1::[h3index(), ...], X2::resolution()) -> [h3index(), ...]

Uncompacts given list of indexes to the given resolution.


Generated by EDoc