create_distance_cs: Creates a distance-based conductance matrix

View source: R/create_distance_cs.R

create_distance_csR Documentation

Creates a distance-based conductance matrix

Description

Creates a conductance matrix based on the distance between neighbouring cells. Distance corrected for if neighbours value is greater than 4.

Usage

create_distance_cs(x, neighbours = 16, max_slope = NULL, exaggeration = FALSE)

Arguments

x

SpatRaster. Digital Elevation Model (DEM)

neighbours

numeric value. Number of directions used in the conductance matrix calculation. Expected numeric values are 4, 8, 16, 32, 48, or matrix object. 16 (default)

max_slope

numeric value. Maximum percentage slope that is traversable. Slope values that are greater than the specified max_slope are given a conductivity value of 0. If cost_function argument is 'campbell 2019' then max_slope is fixed at 30 degrees slope to reflect the maximum slope that the cost function is parametised to. NULL (default)

exaggeration

logical. if TRUE, positive slope values (up-hill movement) multiplied by 1.99 and negative slope values (down-hill movement) multiplied by 2.31

Value

conductanceMatrix that numerically expresses the difficulty of moving across slope based on the provided cost function

Author(s)

Joseph Lewis

Examples


r <- terra::rast(system.file("extdata/SICILY_1000m.tif", package="leastcostpath"))

distance_cs <- create_distance_cs(x = r, neighbours = 4)

josephlewis/leastcostpath documentation built on Oct. 18, 2023, 2:03 p.m.