Skip to content
Prev 18813 / 29559 Next

Problem Setting Projection of Rasters upon Import

On Fri, 12 Jul 2013, Michael Treglia wrote:

            
Are your raster package versions different? In current raster, 
R/rasterFromGDAL.R in line 129 sets crs="", and because in line 152 the 
assigned value in:

projection(r) <- attr(gdalinfo, 'projection')

is NA, you get what you see. My guess is that if your crs= argument is 
neither missing nor NA or the empty string, it should poverride 
attr(gdalinfo, 'projection').

Providing the version of your older installation of raster will help 
isolate when and which change has led to this outcome, but you do have a 
workaround. I can't see the offending revision in SCM in R-forge.

Roger