A nested spatial partition: a flat table of weighted leaf regions ("atoms") plus the ordered hierarchy of levels that groups them.
Usage
Geoscale(leaves, levels, members, geometry = NULL, meta = list())Arguments
- leaves
data.framewith a uniqueregionkey column, one column per level inlevels, and one or more numeric weight columns.- levels
Ordered character vector of level names (coarsest first); each name must appear as a column in
leaves.- members
Named list;
members[[lvl]]is the full ordered set of codes present at levellvl. Must equal the non-NAvalues ofleaves[[lvl]]as a set.- geometry
Optional
sfc(orNULL) with one geometry per row ofleaves, in the same order.- meta
Named list of attributes (
name,desc,weights,default_weight,crs,source,labels).
Details
Construct with geoscale_from_leaves() (the general escape hatch),
geoscale_build() (from a parent-child mapping), or
geoscale_from_provider() (from a data source such as Natural Earth).