Skip to contents

This function returns the average edge length of an H3 cell edge at a given resolution.

Usage

res_length(res = NULL, units = c("m", "km"), fast = TRUE)

Arguments

res

Integer; Desired H3 resolution. See https://h3geo.org/docs/core-library/restable/ for allowable values and related dimensions.

units

Length unit to report in. Options are meters or kilometers.

fast

Logical; whether to retrieve values from a locally stored table or recalculate from source.

Value

Numeric; H3 cell edge length

Note

This value is also the hexagon circumradius.

Examples

# Return average H3 cell edge length at each resolution in kilometers
res_length(res = seq(0, 15), units = 'km')
#>  [1] 1.107713e+03 4.186760e+02 1.582447e+02 5.981086e+01 2.260638e+01
#>  [6] 8.544408e+00 3.229483e+00 1.220630e+00 4.613547e-01 1.743757e-01
#> [11] 6.590781e-02 2.491056e-02 9.415526e-03 3.559893e-03 1.348575e-03
#> [16] 5.097130e-04