Skip to main content

Crate a5

Crate a5 

Source

Structs§

A5Cell
A5 Cell represents a position in the A5 hierarchical indexing system
Degrees
Angle measurement in degrees.
LonLat
Geographic coordinates using longitude and latitude in degrees.
Radians
Angle measurement in radians.

Constants§

MAX_RESOLUTION
WORLD_CELL

Functions§

cell_area
Returns the area of a cell at a given resolution in square meters.
cell_to_boundary
Convert A5 cell ID to boundary coordinates
cell_to_children
cell_to_lonlat
Convert A5 cell ID to lon/lat coordinates of cell center
cell_to_parent
Walk a cell up the hierarchy to a coarser resolution.
compact
Compacts a set of A5 cells by replacing complete groups of sibling cells with their parent cells.
get_num_cells
Returns the number of cells at a given resolution.
get_num_children
Returns the number of children between two resolutions.
get_res0_cells
Returns resolution 0 cells of the A5 system, which serve as a starting point for all higher-resolution subdivisions in the hierarchy.
get_resolution
grid_disk
Compute the grid disk of edge-sharing neighbors within k hops. Returns a sorted, compacted list of cell IDs including the center cell.
grid_disk_vertex
Compute the grid disk of all neighbors (edge + vertex sharing) within k hops. Returns a sorted, compacted list of cell IDs including the center cell.
hex_to_u64
Converts a hexadecimal string to a u64
line_string_to_cells
Trace cells along a polyline defined by a sequence of waypoints.
lonlat_to_cell
Convert lon/lat coordinates to A5 cell ID
polygon_to_cells
Find all cells within a polygon using center-point containment: a cell is included iff its center lies inside the polygon. The result is compacted — use uncompact to expand to the input resolution.
spherical_cap
Compute all cells within a great-circle radius, returning a naturally compacted result (mix of resolutions).
u64_to_hex
Converts a u64 to a hexadecimal string
uncompact
Expands a set of A5 cells to a target resolution by generating all descendant cells.