[R-sig-Geo] gdalwarp gives different cellsize when re-projected

Swagath Navin swagathnavin82 at gmail.com
Thu Mar 7 14:29:24 CET 2013


Dear all,

I have a large data-frame with Lon, Lat , Value . Coordinates projected 
in EPSG:3035 with a resolution of 5 kmx5 km. I converted this into a 
SGDF. My goal was to project the file into EPSG:4326 with a resolution 
of 0.05. For re-projecting  i converted the file to tif using

writeGDAL(df, "file.tif")

and used the gdalwarp

gdalwarp file.tif outfile.tif -t_srs "+init=epsg:4326"

However while comparing both files the cell size is different.

getGridTopology(file1)
                         x       y
cellcentre.offset 2638500 1430500
cellsize             5000    5000
cells.dim             664     797
projargs: chr " +proj=laea +lat_0=52 +lon_0=10 +x_0=4321000 +y_0=3210000 
+ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"

getGridTopology(file2)
                            x            y
cellcentre.offset  -31.31150705  34.11186136
cellsize             0.06515996   0.06515996
cells.dim         1254.00000000 580.00000000

projargs: chr " +proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 
+towgs84=0,0,0"

Can anyone please tell me where it went wrong.

Thanks for your time.



More information about the R-sig-Geo mailing list