create_lcp_density: creates a cumulative least-cost path raster

View source: R/create_lcp_density.R

create_lcp_densityR Documentation

creates a cumulative least-cost path raster

Description

Cumulatively combines least-cost paths to idenify routes of preferential movement

Usage

create_lcp_density(x, lcps, rescale = FALSE)

Arguments

x

SpatRaster

lcps

sf or spatVector

rescale

logical. if TRUE, values scaled to between 0 and 1. FALSE (default)

Value

SpatRaster

Author(s)

Joseph Lewis

Examples


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

slope_cs <- create_slope_cs(x = r, cost_function = "tobler", neighbours = 4)

locs <- sf::st_sf(geometry = sf::st_sfc(
sf::st_point(c(839769, 4199443)),
sf::st_point(c(1038608, 4100024)),
sf::st_point(c(907695, 4145478)),
crs = terra::crs(r)))

lcps <- create_FETE_lcps(x = slope_cs, locations = locs)

lcps_dens <- create_lcp_density(x = r, lcps = lcps)

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