Skip to content
Prev 8688 / 29559 Next

spTransform changes the class

Hi!

I use spTransform to reproject:
[1] "SpatialGrid"
attr(,"package")
[1] "sp"
[1] "+proj=longlat +ellps=WGS84"
[1] "+proj=laea +lat_0=52 +lon_0=10 +x_0=4321000 +y_0=3210000
+ellps=GRS80 +units=m +no_defs"

This is good, but:
[1] "SpatialPoints"
attr(,"package")
[1] "sp"

Why is the class changed to SpatialPoints? I need a grid object for
don't I?

I also have the problem that the CRS of eugrd025EFDCr is not conserved:
[1] "+proj=laea +lat_0=52 +lon_0=10 +x_0=4321000 +y_0=3210000
+ellps=GRS80 +units=m +no_defs"
[1] "+proj=laea +lat_0=52 +lon_0=10 +x_0=4321000 +y_0=3210000
+ellps=GRS80 +units=m +no_defs"
[1] "NA"

which I fix with
and repeat
Anyway, I get a much coarser raster than I want:
[1] 10 10  1

because
[1] 10 10  1

While it should be 180x100:
Object of class SpatialPoints
Coordinates:
       min     max
s1 2498538 6561151
s2 1327858 4313263
Is projected: TRUE
proj4string :
[+proj=laea +lat_0=52 +lon_0=10 +x_0=4321000 +y_0=3210000 +ellps=GRS80
+units=m +no_defs]
Number of points: 18000
[1] 10 10  1
Object of class SpatialGrid
Coordinates:
              min    max
coords.x1 -10.125 34.875
coords.x2  34.875 59.875
Is projected: FALSE
proj4string : [+proj=longlat +ellps=WGS84]
Number of points: 2
Grid attributes:
  cellcentre.offset cellsize cells.dim
1               -10     0.25       180
2                35     0.25       100

Is eugrd025EFDCr wrong because class(eugrd025EFDC) has been changed
from SpatialGrid to SpatialPoints?

Agus