gt_projectRaster: Project geotrellis raster to a new coordinate system

Description Usage Arguments Details Value Examples

Description

This function reprojects a geotrellis raster data gt_RasterLayer object to a new coordinate system. This function is similar to projectRaster.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
## S4 method for signature 'gt_RasterLayer'
gt_aggregate(x, fact, fun = c("mean", "mode",
  "median", "max", "min"))

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

gt_projectRaster(from, to, res, method)

## S4 method for signature 'gt_RasterLayer,CRS'
gt_projectRaster(from, to, res,
  method = c("bilinear", "ngb"))

## S4 method for signature 'gt_RasterLayer,gt_RasterLayer'
gt_projectRaster(from, to,
  method = c("bilinear", "ngb"))

Arguments

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.

from

gt_RasterLayer object.

to

A gt_RasterLayer or CRS object with to reproject from to.

...

additional arguments.

res

numeric resolution to reproject the data to. This is required when to is a CRS object.

Details

Note that–unlike projectRaster–this function does not have a to argument. Therefore users cannot specify a template projected raster to reproject a project gt_RasterLayer and ensure that the returned raster has a specific extent and dimensionality.

Value

gt_RasterLayer object.

Examples

1
2
3
4
5
6
7
## 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))
result <- gt_projectRaster(g, sp::CRS('+init=epsg:3395'), res=50000, method='ngb')

## End(Not run)

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