Areal-weighted interpolation of polygon data

st_interpolate_aw(x, to, extensive, ...)

## Arguments

x |
object of class `sf` , for which we want to aggregate attributes |

to |
object of class `sf` or `sfc` , with the target geometries |

extensive |
logical; if TRUE, the attribute variables are assumed to be spatially extensive (like population) and the sum is preserved, otherwise, spatially intensive (like population density) and the mean is preserved. |

... |
ignored |

## Examples

#> Reading layer `nc' from data source `/tmp/Rtmp6L49NN/temp_libpath64c667a0cdba/sf/shape/nc.shp' using driver `ESRI Shapefile'
#> Simple feature collection with 100 features and 14 fields
#> geometry type: MULTIPOLYGON
#> dimension: XY
#> bbox: xmin: -84.32385 ymin: 33.88199 xmax: -75.45698 ymax: 36.58965
#> CRS: 4267

#> although coordinates are longitude/latitude, st_relate_pattern assumes that they are planar

a1 = st_interpolate_aw(nc["BIR74"], g, extensive = FALSE)

#> Warning: st_interpolate_aw assumes attributes are constant over areas of x

#> although coordinates are longitude/latitude, st_intersection assumes that they are planar

#> [1] 1.436176

a2 = st_interpolate_aw(nc["BIR74"], g, extensive = TRUE)

#> Warning: st_interpolate_aw assumes attributes are constant over areas of x

#> although coordinates are longitude/latitude, st_intersection assumes that they are planar

#> [1] 1.000038