Skip to content
Prev 315656 / 398506 Next

How to re-project ease( Equal Area Scalable Earth) grid with a ~25 km cylindrical projection to WGS84 0.25 degree?

On Fri, Jan 18, 2013 at 5:11 PM, Jonsson <amen.alyaari at bordeaux.inra.fr> wrote:

            
And what is the error telling you? That there's no method for
spTransform that applies to RasterLayers.

 To transform a raster from one projection to another you need to use
projectRaster from the raster package. Note that generally this can
involve warping a raster and interpolating the new values to get a
grid of cells in the new coordinate system.

 But... you were trying to do this:

 a <- spTransform(d, CRS ("+proj=longlat +ellps=WGS84 +datum=WGS84  +no_defs"))

where d was:

 coord. ref. : +proj=longlat +datum=WGS84

 - which is a no-op. The source and destination have the same
coordinate reference system. You need to tell raster what the
coordinate system of the source is. See ?projection - note this
doesn't change the raster or do any projection, its just to tell the
system what the coordinates in the data represent - lat,long or metres
or whatever..

I looked in the HDR file and saw nothing about the projection, so I
don't know how to specify what you've got.

 Also, you didn't point us to the .nc file you used in your example.

Also also, you should probably be posting to R-sig-geo.

Barry