mosaic_aggregate | R Documentation |
Aggregate a SpatRaster to create a new SpatRaster with a lower resolution (larger cells), using the GDAL's gdal_translate utility https://gdal.org/programs/gdal_translate.html
mosaic_aggregate(mosaic, pct = 50, fun = "nearest", in_memory = TRUE)
mosaic |
SpatRaster |
pct |
The size as a fraction (percentage) of the input image size. Either a scalar (eg., 50), or a length-two numeric vector. In the last, different percentage reduction/expansion can be used for columns, and rows, respectively. |
fun |
The resampling function. Defaults to |
in_memory |
Wheter to return an 'in-memory' |
SpatRaster
library(pliman)
library(terra)
r <- rast()
values(r) <- 1:ncell(r)
r2 <- mosaic_aggregate(r, pct = 10)
opar <- par(no.readonly = TRUE)
par(mfrow=c(1,2))
mosaic_plot(r)
mosaic_plot(r2)
par(opar)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.