projectRaster: Project a RasterArray object

Description Usage Arguments Value Examples

Description

The method implemets the projectRaster function for RasterArray class objects.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
projectRaster(
  from,
  to,
  res,
  crs,
  method = "bilinear",
  alignOnly = FALSE,
  over = FALSE,
  filename = "",
  ...
)

## S4 method for signature 'RasterArray'
projectRaster(
  from,
  to,
  res,
  crs,
  method = "bilinear",
  alignOnly = FALSE,
  over = FALSE
)

Arguments

from

A Raster* RasterArray object to project.

to

Raster* object with the parameters to which 'from' should be projected

res

single or (vector of) two numerics. To, optionally, set the output resolution if 'to' is missing

crs

character or object of class 'CRS'. PROJ.4 description of the coordinate reference system. In projectRaster this is used to set the output CRS if 'to' is missing, or if 'to' has no valid CRS

method

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

alignOnly

logical. Use to or other parameters only to align the output (i.e. same origin and resolution), but use the projected extent from from

over

logical. If TRUE wrapping around the date-line is turned off. This can be desirable for global data (to avoid mapping the same areas twice) but it is not desireable in other cases

filename

character output filname. Not applicable for RasterArray class objects.

...

additional arguments as for writeRaster.

Value

A projected RasterArray class object.

Examples

1
2
3
4
5
# project first three to mollweide
data(dems)
suppressWarnings(
  mollDem <- projectRaster(dems[1:3], crs=CRS("+proj=moll"))
)

chronosphere documentation built on April 19, 2021, 1:07 a.m.