Every (coarser, finer) code pair that shares at least one leaf, for all
geoframe pairs.
Arguments
- x
A
GeoScale.
Details
Computed leaf-mediated, directly from @leaftable — deliberately not
as a transitive closure of geoscale_family(). timescales can use a
closure because timeframes genuinely nest; spatial geoframes cross-cut, and
a closure then manufactures false relationships. In the example GeoScale,
zone ZB
straddles both countries, so closing country -> state -> zone -> cell
would wrongly report country N as an ancestor of leaf A5, which lies in
country S.
For geoframes that do not nest this relation is overlap, not containment —
test a given pair with geoscale_nests().
Geoframe columns are retained because region codes are not unique across
geoframes: in the example, "N1" exists at both state and zone, so a
bare (parent, child) pair would read as a self-loop.
Examples
head(geoscale_ancestry(geoscale_example()))
#> parent_geoframe parent child_geoframe child
#> 1 country N cell A1
#> 2 country N cell A2
#> 3 country N cell A3
#> 4 country N cell A4
#> 5 country N state N1
#> 6 country N state N2
