projectGrid: grid datum definition and transformation

View source: R/projectGrid.R

projectGridR Documentation

grid datum definition and transformation

Description

Defines and/or transforms the projection of a grid (or station data) by means of a CRS object.

Usage

projectGrid(grid, original.CRS = "", new.CRS = "")

Arguments

grid

a grid or multigrid (including station data).

original.CRS

character as passed to function CRS. It defines the original projection. If the data contains the projection information, a warning is returned and the projection in redefined.

new.CRS

character as passed to function CRS.

Details

This function uses spTransform, CRS and proj4string from package sp

Author(s)

M. Iturbide

See Also

spTransform, proj4string.

Examples

library(climate4R.datasets)
data("VALUE_Iberia_pr")
plot(getCoordinates(VALUE_Iberia_pr))
grid <- projectGrid(VALUE_Iberia_pr,
                    original.CRS = "+proj=longlat +datum=WGS84 +ellps=WGS84 +towgs84=0,0,0",
                    new.CRS = "+init=epsg:28992")
plot(getCoordinates(grid))

data("EOBS_Iberia_pr")
plot(get2DmatCoordinates(EOBS_Iberia_pr))
grid <- projectGrid(EOBS_Iberia_pr,
                    original.CRS = "+proj=longlat +datum=WGS84 +ellps=WGS84 +towgs84=0,0,0",
                    new.CRS = "+init=epsg:28992")
plot(get2DmatCoordinates(grid))
require(visualizeR)
spatialPlot(climatology(grid))

SantanderMetGroup/geoprocessoR documentation built on June 29, 2023, 9:41 p.m.