crop: Crop Satellite object

Description Usage Arguments Details Value References See Also Examples

Description

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

Usage

1
2
## 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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
## 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 documentation built on Jan. 11, 2020, 9:26 a.m.