Function used to extract values of a single- or multi- band raster for pixels corresponding to the features of a vector (Polygon, Point or Line)
aggregate_rast(in_val_rast, in_zones_rast, FUN = mean, maxchunk = 5e+07, method = "disk", out_type = "rastobject", out_file = NULL, nodata_in = NULL, verbose = TRUE, overwrite = FALSE)
in_val_rast | Object of class |
---|---|
in_zones_rast | PARAM_DESCRIPTION |
FUN | PARAM_DESCRIPTION, Default: mean |
maxchunk | PARAM_DESCRIPTION, Default: 5e+07 |
method | PARAM_DESCRIPTION, Default: "disk" |
out_type | PARAM_DESCRIPTION, Default: 'rastobject' |
out_file | PARAM_DESCRIPTION, Default: NULL |
nodata_in | PARAM_DESCRIPTION, Default: NULL |
verbose | PARAM_DESCRIPTION, Default: TRUE |
overwrite |
|
OUTPUT_DESCRIPTION
DETAILS
in_file <- system.file("extdata/MODIS_test", "EVIts_test.tif", package = "sprawl.data") in_rast <- read_rast(in_file, bands = 20) tempraster <- tempfile(fileext = ".tif") in_obj_zones <- raster::aggregate(in_rast, fact = 4, filename = tempraster, overwrite = TRUE) test <- aggregate_rast(in_rast, in_obj_zones, FUN = mean)#>#>#>#>#> #>#>#> #>#>#> #>#>#> #>#>#> #>#> #>#>#> #>#>#> #>#>#> #>#>#> #>#>