gt_crop: Crop geotrellis raster data

Description Usage Arguments Details Value Examples

Description

Crop returns a geographic subset of an gt_RasterLayer object as specified by another gt_RasterLayer object.

Usage

1
2
3
4
5
6
7
gt_crop(x, y)

## S4 method for signature 'gt_RasterLayer,Extent'
gt_crop(x, y)

## S4 method for signature 'gt_RasterLayer,gt_RasterLayer'
gt_crop(x, y)

Arguments

x

gt_RasterLayer object.

y

Extent or gt_RasterLayer object.

Details

This function is similar to crop, except that y must be a gt_RasterLayer object and not just any Spatial object.

Value

gt_RasterLayer object.

Examples

1
2
3
4
5
6
7
8
## Not run: 
g <- gt_raster(raster::raster(matrix(c(1:6), ncol=3),
                              crs=sp::CRS('+init=epsg:4326'),
                              xmn=0, xmx=3, ymn=2, ymx=10))
ext <- extent(c(0, 3, 2, 6))
result <- gt_crop(g, ext)

## End(Not run)

jeffreyhanson/geotrellis documentation built on May 19, 2019, 4 a.m.