Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

crop

Crop Satellite object


Description

The function is a wrapper around the crop function to easily crop a Satellite object by an extent object.

Usage

## S4 method for signature 'Satellite'
crop(x, y, subset = TRUE, snap = "near")

Arguments

x

Satellite object.

y

extent object.

subset

Logical; if TRUE (default), all layers but the cropped ones are being dropped; if FALSE, cropped layers are appended to the Satellite object.

snap

Direction towards which to align the extent as character. Available options are "near" (default), "in" and "out" (see alignExtent).

Details

Crop layers of a Satellite object to the size of a given raster::extent object.

Value

A Satellite object consisting of cropped layers only. If subset = FALSE, a Satellite object with the cropped layers appended.

References

Please refer to the respective functions for references.

See Also

This function is a wrapper for raster::crop.

Examples

## Not run: 
## sample data
path <- system.file("extdata", package = "satellite")
files <- list.files(path, pattern = glob2rx("LC08*.TIF"), full.names = TRUE)
sat <- satellite(files)

## geographic extent of georg-gassmann-stadium (utm 32-n)
ext_ggs <- raster::extent(484015, 484143, 5627835, 5628020)

## crop satellite object by specified extent
sat_ggs <- crop(sat, ext_ggs)

plot(sat)
plot(sat_ggs)

## End(Not run)

satellite

Handling and Manipulating Remote Sensing Data

v1.0.2
MIT + file LICENSE
Authors
Thomas Nauss, Hanna Meyer, Tim Appelhans, Florian Detsch
Initial release
2019-12-06

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.