Data validation for aggregate_raster_to_polygons
aggregate_raster_to_polygons_validation(
data_raster,
aggregation_table,
aggregation_cols,
method,
aggregated_field,
z_dimension,
z_dimension_name,
weighting_raster,
na.rm
)
Errors if checks fail; silently passes if checks pass
terra::SpatRaster containing data to be aggregated to polygons.
Aggregation table linking pixels to polygon identifiers,
created using build_aggregation_table()
(character vector, default 'polygon_id') Polygon identifiers to use for aggregation.
(character, default 'mean') Aggregation method: one of 'mean', 'sum', 'weighted.mean', or 'weighted.sum'.
(character, default 'data') Name of the aggregated raster values in the output table.
(vector, default NULL) If passing a data_raster
with multiple
layers, how should each layer be identified?
(default 'z') The field name for the "z" dimension
corresponding to each layer of the data_raster
.
(terra::SpatRaster, default NULL) The relative weighting of each whole pixel to the overall polygon value, for example, if calculating a population-weighted mean.
(bool, default TRUE) How to handle NA pixels in data_raster
and
weighting_raster
.
aggregate_raster_to_polygons