crop_cs {leastcostpath} | R Documentation |
Crop conductanceMatrix to extent
Description
Crop conductanceMatrix to extent
Usage
crop_cs(x, extent)
Arguments
x |
|
extent |
|
Details
conductanceMatrix cropped to extent of supplied Sf object
or terra SpatRaster
. conductanceMatrix spatRaster dimensions and Matrix dimensions update to reflect cropped extent
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)
ext <- sf::st_as_sfc(sf::st_bbox(rasterise(slope_cs)))
ext <- sf::st_buffer(ext, dist = -75000)
ext <- sf::st_as_sf(ext)
slope_cs_cropped <- crop_cs(slope_cs, extent = ext)
[Package leastcostpath version 2.0.12 Index]