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.
See also
Other CLC class functions:
as_raster()
,
clc()
,
copy_to()
,
get_colors.clc()
,
get_levels.clc()
,
get_raster()
,
plot_clc()
,
prepare_plot()
,
save_to()
Examples
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)