resampleR: Fast Resample RasterLayer object

Description Usage Arguments Details Value Author(s) Examples

View source: R/resample_R.R

Description

This function allows manipulating the geometry of one RasterLayer object.

Usage

1
2
resampleR(R1 = NULL, R2 = NULL, t_res = NULL, t_ext = NULL,
  Routput = "~/")

Arguments

R1

Is a RasterLayer object to resample.

R2

Is a RasterLayer object that contains the CRS and desired geometry.

t_res

Numeric. Is the pixel resolution (c(xres,yres))

t_ext

Numeric.(c(xmin,ymin,xmax,ymax)). set georeferenced extents of output file to be created (in target SRS).

Routput

Character. The destination file name.

Details

This function use gdalwarp for resampling RasterLayer object and implement the two next possible situations. The first is that you have two RasterLayer objects and you want to change the geometries and SRC of the first using the second. The second possibility is that you have one RasterLayer object and you know the pixel resolution and the extents.

Value

A RasterLayer object

Author(s)

Cesar Aybar <aybar1994@gmail.com>

Examples

1
2
3
4
5
6
7
library(raster)
library(Dorado)
data("Dorado")
r_prec<-system.file("external/raster/Chirp_1981_01_01.tif",package = "Dorado")
Prec_Bolivia<-raster(r_prec)
#resampleR(R1=Prec_Bolivia,R2=Dorado$gauge,Routput = "./")
#Second Case

AybarCL/Dorado documentation built on Jan. 13, 2020, 1:13 p.m.