nesting {SUNGEO}R Documentation

Relative scale and nesting coefficients

Description

Function to calculate relative scale and nesting metrics for changes of support from a source polygon layer to an overlapping (but spatially misaligned) destination polygon layer.

Usage

nesting(
  poly_from = NULL,
  poly_to = NULL,
  metrix = "all",
  tol_ = 0.001,
  by_unit = FALSE
)

Arguments

poly_from

Source polygon layer. sf object (polygon or multipolygon).

poly_to

Destination polygon layer. Must have identical CRS to poly_from. sf object (polygon or multipolygon).

metrix

Requested scaling and nesting metrics. See "details". Default is "all". Character string or vector of character strings.

tol_

Minimum area of polygon intersection, in square meters. Default is 0.001. Numeric.

by_unit

Include a by-unit decomposition of requested nesting metrics (if available)? Default is FALSE. Logical.

Details

Currently supported metrics (metrix) include:

It is possible to pass multiple arguments to metrix (e.g. metrix=c("rn","rs")). The default (metrix="all") returns all of the above metrics.

The function automatically reprojects source and destination geometries to Lambert Equal Area prior to calculation, with map units in meters.

Values of tol_ can be adjusted to increase or decrease the sensitivity of these metrics to small border misalignments. The default value discards polygon intersections smaller than 0.001 square meters in area.

Value

Named list, with numeric values for each requested metric in metrix. If by_unit==TRUE, last element of list is a data.table, with nesting metrics disaggregated by source unit, where the first column is a row index for the source polygon layer.

Examples

# Calculate all scale and nesting metrics for two sets of polygons
## Not run: 
data(clea_deu2009)
data(hex_05_deu)
nest_1 <- nesting(
              poly_from = clea_deu2009,
              poly_to = hex_05_deu
              )
nest_1

## End(Not run)

# Calculate just Relative Nesting, in the opposite direction
## Not run: 
nest_2 <- nesting(
              poly_from = hex_05_deu,
              poly_to = clea_deu2009,
              metrix = "rn"
              )
nest_2

## End(Not run)

[Package SUNGEO version 1.3.0 Index]