Skip to content
Prev 21449 / 29559 Next

spTransform() error : "load package rgdal for spTransform methods"

On Wed, 6 Aug 2014, Remi Genevest wrote:

            
Thanks for the example. You cannot use spTransform on SpatialGrid objects 
- this is known as warping, and does not return a regular grid in general. 
You can do:

grd<-spTransform(as(grd, "SpatialPoints"), CRS("+init=epsg:3857"))

but:

gridded(grd) <- TRUE
#suggested tolerance minimum: 0.223608
#Error in points2grid(points, tolerance, round) :
#  dimension 2 : coordinate intervals are not constant

Try warping instead.

Hope this clarifies,

Roger