Initialize the surface area for a 2.5D MKDE.
initializeAreaRaster(mkde.obj)
Returns a 2.5 MKDE object with an initialized area raster.
An MKDE object created using initialize2DMKDE
Jeff A. Tracey, PhD
USGS Western Ecological Research Center, San Diego Field Station
jatracey@usgs.gov
James Sheppard, PhD
San Diego Zoo Institute for Conservation Research
jsheppard@sandiegozoo.org
After creating the MKDE object and setting the lower bounds in the
z-dimension using setMinimumZfromRaster
, this function computes
the surface area of each raster cell and sets the dimension of the
MKDE object to 2.5.
library(terra)
fpath <- system.file("extdata", "pandadem.RDS", package="mkde")
pandadem <- terra::readRDS(fpath)
cell.sz <- mean(res(pandadem))
ext <- ext(pandadem)
nx <- ncol(pandadem)
ny <- nrow(pandadem)
mkde.obj <- initializeMKDE2D(ext$xmin, cell.sz, nx, ext$ymin, cell.sz, ny)
mkde.obj <- setMinimumZfromRaster(mkde.obj, pandadem)
mkde.obj <- initializeAreaRaster(mkde.obj)
Run the code above in your browser using DataLab