leastcostpath (version 1.2.1)

create_banded_lcps: create_banded_lcps

Description

Calculates Least Cost Paths from random locations within distances

Usage

create_banded_lcps(cost_surface, location, min_distance, max_distance,
  radial_points, cost_distance = FALSE, parallel = FALSE)

Arguments

cost_surface

TransitionLayer object (gdistance package). Cost surface to be used in Least Cost Path calculation

location

SpatialPoints. Location from which the Least Cost Paths are calculated. Only the first cell is taken into account

min_distance

numeric value. minimum distance from centre location

max_distance

numeric value. maximum distance from centre location

radial_points

numeric value. Number of random locations around centre location within distances

cost_distance

if TRUE computes total accumulated cost for each Least Cost Path. Default is FALSE

parallel

if TRUE, the Least Cost Paths will be calculated in parallel. Number of Parallel socket clusters is total number of cores available minus 1. Default is FALSE

Value

SpatialLinesDataFrame (sp package). The resultant object contains least cost paths (number of LCPs is dependent on radial_points argument) calculated from a centre location to random locations within a specified distance band.

Details

Computes Least Cost Paths from centre location to random locations within a specified distance band. This is based on the method proposed by Llobera (2015).

Examples

Run this code
# NOT RUN {
#r <- raster::raster(nrow=50, ncol=50,  xmn=0, xmx=50, ymn=0, ymx=50, crs='+proj=utm')

#r[] <- stats::runif(1:length(r))

#slope_cs <- create_slope_cs(r, cost_function = 'tobler')

#locs <- sp::spsample(as(r, 'SpatialPolygons'),n=1,'random')

#lcp_network <- create_banded_lcps(cost_surface = final_cost_cs, location = locs, min_distance = 20,
#max_distance = 50, radial_points = 10, cost_distance = FALSE, parallel = FALSE)

# }

Run the code above in your browser using DataCamp Workspace