a5_covering_measures: Measure coverings

a5_covering_measuresR Documentation

Measure coverings

Description

a5_count() returns the number of cells each covering stands for at its resolution: the length of its a5_uncompact() result, without building it. This differs from the number of cells stored. a5_area() returns the area of each covering. A5 cells are equal-area, so this is exact up to rounding: the count times a5_cell_area() at the covering's resolution.

Usage

a5_count(x)

a5_area(x, units = "m^2")

Arguments

x

An a5_covering vector, or an object as_a5_covering() accepts.

units

Character scalar area unit for a5_area() (default "m^2"). Any unit units::set_units() can convert to is accepted (e.g. "km^2", "ha"). If NULL, a plain numeric vector in square metres.

Details

Counts are doubles, exact up to 2^53 (about 9e15 cells); coverings at the finest resolutions can stand for more, and those counts are rounded.

Value

a5_count(): a numeric vector the length of x. a5_area(): a units::units vector the length of x, or numeric when units = NULL. NA for a missing covering.

See Also

a5_cell_area() for the area of a single cell.

Examples

cell <- a5_lonlat_to_cell(-3.19, 55.95, resolution = 12)
cap <- a5_spherical_cap(cell, radius = 10000)
cap
a5_count(cap)
a5_area(cap, units = "km^2")

a5R documentation built on Oct. 19, 2026, 5:08 p.m.