crop_cs | R Documentation |
Crop conductanceMatrix to extent
crop_cs(x, extent)
x |
|
extent |
|
conductanceMatrix cropped to extent of supplied Sf object
or terra SpatRaster
. conductanceMatrix spatRaster dimensions and Matrix dimensions update to reflect cropped extent
Joseph Lewis
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.