This function aggregates geotrellis raster layer data gt_RasterLayer.

gt_aggregate(x, ...)

Arguments

x
gt_RasterLayer object.
fact
integer Aggregation factor expressed as number of cells in each direction.
fun
character name of function used to aggregate values. Available functions are 'mean', 'mode', 'median', 'max', and 'min'. Defaults to 'mean'.

Examples

## Not run: ------------------------------------ # g <- gt_raster(raster::raster(matrix(runif(9), ncol=3), # crs=sp::CRS('+init=epsg:4326'), # xmn=0, xmx=3, ymn=2, ymx=10)) # result <- gt_aggregate(g, fact=2, fun='mean') ## ---------------------------------------------