crop-scidbst-method: Crop / spatial subset function

Description Usage Arguments Value Note See Also Examples

Description

This function is based on the similar function in the raster package. It creates a spatial subset of a scidbst array and returns the subset scidbst object. Internally, this function will calculate the spatial indices of the extent object and will use this as boundaries for the spatial dimensions. 'crop' will delegate the subset creation to the 'subarray' method.

Usage

1
2
## S4 method for signature 'scidbst'
crop(x, y, snap = "near", ..., between = TRUE)

Arguments

x

scidbst object

y

Extent object, or any object from which an Extent object can be extracted

snap

Character. One of 'near', 'in', or 'out', for use with alignExtent

...

Additional arguments as for writeRaster

between

(logical) whether or not to use 'between' or 'subarray' as scidb operation

Value

scidbst object with refined spatial extent

Note

For proper use the new extent has to contain coordinates that have the same reference system as the scidbst object.

See Also

crop or subarray,scidbst

Examples

1
2
3
4
5
6
7
8
9
## Not run: 
scidbconnect(...)
scidbst.obj = scidbst(array_name)
e = extent(scidbst.obj)
ymax(e) = ymin(e)+((ymax(e)-ymin(e))/4)
xmax(e) = xmin(e)+((xmax(e)-xmin(e))/4)
cropped = crop(scidbst.obj,e)

## End(Not run)

flahn/scidbst documentation built on May 16, 2019, 1:15 p.m.