upscale: upscale

View source: R/upscale.R

upscaleR Documentation

upscale

Description

upscale an input raster to an output grid using an area preserving method

Usage

upscale(input, cellsize, no_data = NA, nthread = NULL, verbose = FALSE)

Arguments

input

(SpatRaster) a terra raster with fine resolution

cellsize

(numeric) cell resolution in units of input CRS of output target grid. The value should be always larger than input resolution.

no_data

(integer) a value to be treated as NO_DATA. Default to NA.

nthread

(integer) the number of thread to use for parallel. If NULL, the all available cores in the machine will be used. Default to NULL.

verbose

(logical) option to print out info for debugging.

Value

(SpatRaster) a resampled terra raster

Examples

library(APUpscale)
library(terra)
nlcd <- rast(system.file('extdata/nlcd_dukes.tif', package = "APUpscale"))
lc_coarse <- upscale(nlcd, cellsize = 1000, nthread = 2)
coltab(lc_coarse) <- coltab(nlcd)
plot(lc_coarse)

LLeiSong/APUpscale documentation built on June 2, 2022, 12:28 p.m.