The package provides a workable way to upscale huge categorical map using area preserving method. It can ensure both the compositional information and landscape characteristics. It does the calculation in two ways:
terra::zonal
'to summarise cells.collapse
. In order to avoid RAM crash, it uses a conservative way to deal with RAM.NOTE: For a moderate size map, it might be less efficient. And if the base map is large and the upscale factor is small (e.g. upscaling 4m to 30m), it might be very slow but still workable.
You can install the development version from GitHub with:
# install.packages("devtools")
devtools::install_github("LLeiSong/APUpscale")
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)
Johnson, J. Michael, and Keith C. Clarke. "An area preserving method for improved categorical raster resampling." Cartography and Geographic Information Science 48.4 (2021): 292-304.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.