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

Alexandre Villers villers.alexandre at gmail.com
Thu Mar 7 14:52:15 CET 2013


Hello,

Well, given you went from a projected to a geographic coordinates 
system, you changed the unit of the grid from meters to degrees.
So I wouldn't be surprised and I guess nothing went wrong as long you 
specified the correct EPSG for your original file.

HTH

Alex

On 07/03/2013 15:29, Swagath Navin wrote:
> 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.
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>
>



More information about the R-sig-Geo mailing list