gt_mask: Mask geotrellis raster data

Description Usage Arguments Details Value Examples

Description

Mask data in a gt_RasterLayer object using another gt_RasterLayer.

Usage

1
2
3
4
5
gt_mask(x, mask, maskvalue, updatevalue)

## S4 method for signature 'gt_RasterLayer,gt_RasterLayer'
gt_mask(x, mask, maskvalue = NA,
  updatevalue = NA)

Arguments

x

gt_RasterLayer object.

mask

gt_RasterLayer object.

...

not used.

maskvalue

numeric The value in mask that indicates the cells of x that should become missing data values. Defaults to NA.

updatevalue

numeric The value that masked out values in x should becomes. Defaults to NA.

Details

This function is similar to mask, except that masked values in x are always set to missing data values.

Value

gt_RasterLayer object.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## 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))
mask <- gt_raster(raster::raster(matrix(c(NA, 1:4, NA), ncol=3),
                              crs=sp::CRS('+init=epsg:4326'),
                              xmn=0, xmx=3, ymn=2, ymx=10))
result <- gt_mask(g, mask)

## End(Not run)

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