cut_to_extent | R Documentation |
This function clips the object layer using a polygon layer. It handles CRS transformations automatically if necessary, ensuring the output is in the same CRS as the input polygon.
cut_to_extent(clo, polygon)
## S3 method for class 'clc'
cut_to_extent(clo, polygon)
clo |
A 'clc' object. |
polygon |
An 'sf' object representing the polygon layer used for clipping. |
A 'clc' object.
Other CLC class functions:
as_raster()
,
clc()
,
copy_to()
,
get_colors.clc()
,
get_levels.clc()
,
get_raster()
,
plot_clc()
,
prepare_plot()
,
save_to()
source_gpkg <- system.file("extdata", "clc.gpkg", package = "clc")
clo <- clc(source = source_gpkg, layer_name = "clc")
polygon <- sf::st_read(source_gpkg, layer = 'lanjaron', quiet = TRUE)
clo2 <- clo |>
cut_to_extent(polygon)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.