Learn R Programming

satres (version 1.1.1)

clip_bands: Clip all the bands based on a polygon

Description

Clips all bands of each spatial resolution according to the given polygon.

Usage

clip_bands(sr, polygon)

# S3 method for satres clip_bands(sr, polygon)

Value

A satres object.

Arguments

sr

A satres object.

polygon

A sf polygon layer.

Details

It performs the operation independently of the CRS of the polygon and preserves the CRS of the bands.

See Also

satres

Other satellite transformation: merge_tiles(), select_bands()

Examples

Run this code

file <- system.file("extdata", "lanjaron.gpkg", package = "satres")
lanjaron <- sf::st_read(file, layer = "lanjaron_bbox", quiet = TRUE)

esa <- system.file("extdata", "esa", package = "satres")
sr <- satres(dir = esa) |>
     clip_bands(polygon = lanjaron)

Run the code above in your browser using DataLab