Skip to contents

This function helps to stack target data layers from various GeoTIFF maps (with different extents, CRS, and resolutions) to a single map.

Usage

stack_covariates_2_geotiff(
  outdir,
  year,
  base.map.dir,
  cov.tif.file.list,
  normalize = T,
  cores = parallel::detectCores()
)

Arguments

outdir

character: the output directory where the stacked GeoTIFF file will be generated.

year

numeric: the year of when the covariates are stacked.

base.map.dir

character: path to the GeoTIFF file within which the extents and CRS will be used to generate the final map.

cov.tif.file.list

list: a list contains sub-lists with each including path to the corresponding map and the variables to be extracted (e.g., list(LC = list(dir = "path/to/landcover.tiff", var.name = "LC")).

normalize

boolean: decide if we want to normalize each data layer, the default is TRUE.

cores

numeric: how many CPus to be used in the calculation, the default is the total CPU number you have.

Value

path to the exported GeoTIFF file.

Author

Dongchen Zhang