create_distance_cs: Create a Distance based cost surface

View source: R/create_distance_cs.R

create_distance_csR Documentation

Create a Distance based cost surface

Description

Creates a cost surface based on the distance between neighbouring cells. Distance corrected for if neighbours value greater than 4 (diagonal distance greater than straight line distance). Distance units are derived from the maximum resolution of the supplied RasterLayer.

Usage

create_distance_cs(raster, neighbours = 16)

Arguments

raster

RasterLayer (raster package).

neighbours

numeric value. Number of neighbouring cells. See Huber and Church (1985) for methodological considerations when choosing number of neighbours. Expected numeric values are 4, 8, 16, 32, 48 or a matrix object. Default is numeric value 16

Value

TransitionLayer (gdistance package) numerically expressing the distance between neighbouring cells

Author(s)

Joseph Lewis

Examples

r <- raster::raster(system.file('external/maungawhau.grd', package = 'gdistance'))
distance_cs <- create_distance_cs(r, neighbours = 16)

leastcostpath documentation built on June 3, 2022, 9:06 a.m.