Learn R Programming

leastcostpath (version 1.8.7)

create_distance_cs: 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)

Value

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

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

Author

Joseph Lewis

Examples

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

Run the code above in your browser using DataLab