Learn R Programming

leastcostpath (version 1.7.4)

create_CCP_lcps: Calculate Cumulative Cost Paths from Radial Locations

Description

Calculates Least Cost Paths from radial locations of a specified distance to the centre location. This is based on the method proposed by Verhagen (2013).

Usage

create_CCP_lcps(
  cost_surface,
  location,
  distance,
  radial_points,
  cost_distance = FALSE,
  parallel = FALSE
)

Arguments

cost_surface

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

location

SpatialPoints (sp package). Location to which the Least Cost Paths are calculated to. Only the first row is taken into account

distance

numeric value. Distance from centre location to the radial locations

radial_points

numeric value. Number of radial locations around centre location

cost_distance

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

parallel

logical. 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 radial locations to a centre location within a specified distance.

References

Verhagen, P. (2013). On the road to nowhere? Least cost paths, accessibility and the predictive modelling perspective. In Contreras F, Farjas M, Melero FJ (eds). Fusion of cultures. Proceedings of the 38th annual conference on computer applications and quantitative methods in archaeology, Granada, Spain, April 2010. (pp 383-389). Oxford: Archaeopress

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(raster::extent(r), 'SpatialPolygons'),n=1,'regular')

lcp_network <- create_CCP_lcps(cost_surface = slope_cs, location = locs,
distance = 20, radial_points = 10, cost_distance = FALSE, parallel = FALSE)
# }

Run the code above in your browser using DataLab