gt_resample: Resample geotrellis raster data

Description Usage Arguments Details Value Examples

Description

This function resamples a geotrellis raster data gt_RasterLayer object to match the extent, resolution, and dimensionality of another projectRaster.

Usage

1
2
3
4
5
gt_resample(x, y, method)

## S4 method for signature 'gt_RasterLayer,gt_RasterLayer'
gt_resample(x, y,
  method = c("bilinear", "ngb"))

Arguments

x

gt_RasterLayer object.

y

gt_RasterLayer object with parameters that x should be resampled to.

...

not used.

method

character method used to compute values for the new gt_RasterLayer. Either 'ngb' (nearest neighbor), which is useful for categorical variables, or 'bilinear' (bilinear interpolation; the default value), which is appropriate for continuous variables.

Details

This function is similar to resample.

Value

gt_RasterLayer object.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Not run: 
g <- gt_raster(raster::raster(matrix(runif(9), ncol=3),
                              crs=sp::CRS('+init=epsg:4326'),
                              xmn=0, xmx=3, ymn=2, ymx=10))
template <- gt_raster(raster::raster(matrix(runif(4), ncol=2),
                              crs=sp::CRS('+init=epsg:4326'),
                              xmn=0, xmx=3, ymn=2, ymx=10))
result <- gt_resample(g, template, method='bilinear')

## End(Not run)

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