Learn R Programming

leastcostpath (version 1.7.4)

create_barrier_cs: Create Barrier Cost Surface

Description

Creates a cost surface that incorporates barriers that inhibit movement in the landscape.

Usage

create_barrier_cs(raster, barrier, neighbours = 16, background = 1)

Arguments

raster

RasterLayer (raster package). The Resolution, Extent, and Spatial Reference System of the provided RasterLayer is used when creating the resultant Barrier Cost Surface

barrier

Spatial* (sp package). Areas within the landscape that movement is inhibited. See details for more

neighbours

numeric value. Number of directions used in the Least Cost Path calculation. 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

background

numeric value. Value Value to put in the cells that are not covered by any of the features of barrier. Default is numeric value 1

Value

TransitionLayer (gdistance package) numerically expressing the barriers to movement in the landscape. The resultant TransitionLayer can be incorporated with other TransitionLayer through Raster calculations

Details

The resultant Barrier Cost Surface is produced by assessing which areas of the raster coincide with the Spatial object as specified in the barrier argument. The areas of raster that coincide with the Spatial object are given a conductance value of 0, with all other areas given a Conductance value of 1 (default value). The conductance value of 0 ensures that movement is inhibited within these areas. Examples of use include rivers, lakes, and taboo areas.

Examples

Run this code
# NOT RUN {
r <- raster::raster(system.file('external/maungawhau.grd', package = 'gdistance'))
loc1 = cbind(2667670, 6479000)
loc1 = sp::SpatialPoints(loc1)

barrier <- create_barrier_cs(raster = r, barrier = loc1)
# }

Run the code above in your browser using DataLab