#' Transform EASE-grid projection
#'
#' Transforms the projection of an EASE-grid-projected raster to the WGS84 projection system. Defaults to a 0.25*0.25 degree resolution.
#' @param egRaster EASE-grid-projected \code{raster} object created through \code{\link{convertGrid}}.
#' @export
#' @return \code{raster} object
#' @examples
#' smr <- convertGrid(nc_path = '.../smos.nc', name = 'Soil_Moisture')
#' smrp <- transformTo(egRaster = smr)
transformTo <- function(egRaster,
nrows = 180*4,
ncols = 360*4){
require(raster)
### 0.25*0.25 degree resolution and extent -180, 180, -90, 90
# create template raster
r_template <- raster::raster(xmn = -180,
xmx = 180,
ymn = -90,
ymx = 90,
nrows = nrows,
ncols = ncols,
crs = "+init=epsg:4326")
# project raster
r_new <- raster::projectRaster(egRaster, r)
# return
return(r_new)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.