These methods are generics from the raster package, extended to work for lazyrasters.

# S4 method for lazyraster
crop(x, y, ...)

raster_lazyraster(x, ...)

extent_lazyraster(x, ...)

Arguments

x

various (raster, extent)

y

an object with extent (for crop)

...

arguments passed to underlying raster function

Value

lazyraster() and crop() return a lazyraster object, extent() returns a regular raster extent

Details

For crop() this set an active window of data using the same crop() function as the raster package. This is the data window that will be pulled by conversion to an actual raster by as_raster().

See also

Examples

sstfile <- system.file("extdata/sst.tif", package = "vapour") lr <- lazyraster(sstfile) ## crop and stay as lazyraster crop(lazyraster(sstfile), raster::extent(142, 143, -50, -45))
#> class : LazyRaster #> dimensions : 286, 143 (nrow, ncol) #> resolution : 0.07000000, 0.07000389 (x, y) #> extent : 140.00000, 150.01000, -60.01833, -39.99722 (xmin, xmax, ymin, ymax) #> crs : <placeholder> #> values : NA, NA (min, max - range from entire extent) #> window extent : 141.96000, 143.01000, -50.00778, -44.96750 #> window index : 27, 42, 71, 143 #> window dimension : 16, 73 (ncol, nrow)