Skip to content
Prev 16681 / 29559 Next

raster CRS changes on tis own

Hi!
I modify the CRS of a raster object:
CRS arguments:
 +init=epsg:3042 +proj=utm +zone=30 +ellps=GRS80
+towgs84=0,0,0,0,0,0,0 +units=m +no_defs
class       : RasterBrick
dimensions  : 1486, 1162, 1726732, 6  (nrow, ncol, ncell, nlayers)
resolution  : 0.170881, 0.170881  (x, y)
extent      : 578587.4, 578785.9, 4722025, 4722279  (xmin, xmax, ymin, ymax)
coord. ref. : +init=epsg:3042 +proj=utm +zone=30 +ellps=GRS80
+towgs84=0,0,0,0,0,0,0 +units=m +no_defs
data source : /media/Iomega_HDD/UAVetal/vinedo/Clara_final/mosaico_envi.dat
names       : mosaico_envi.1, mosaico_envi.2, mosaico_envi.3,
mosaico_envi.4, mosaico_envi.5, mosaico_envi.6

But then, after a reordering, the CRS changes again on its own:
class       : RasterStack
dimensions  : 1486, 1162, 1726732, 6  (nrow, ncol, ncell, nlayers)
resolution  : 0.170881, 0.170881  (x, y)
extent      : 578587.4, 578785.9, 4722025, 4722279  (xmin, xmax, ymin, ymax)
coord. ref. : +proj=utm +zone=30 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0
+units=m +no_defs
names       : mosaico_envi.3, mosaico_envi.1, mosaico_envi.2,
mosaico_envi.4, mosaico_envi.5, mosaico_envi.6
min values  : NA, NA, NA, NA, NA, NA
max values  : NA, NA, NA, NA, NA, NA

The correct CRS is conserved if I write to GTiff:
class       : RasterStack
dimensions  : 1486, 1162, 1726732, 6  (nrow, ncol, ncell, nlayers)
resolution  : 0.170881, 0.170881  (x, y)
extent      : 578587.4, 578785.9, 4722025, 4722279  (xmin, xmax, ymin, ymax)
coord. ref. : +init=epsg:3042 +proj=utm +zone=30 +ellps=GRS80
+towgs84=0,0,0,0,0,0,0 +units=m +no_defs
names       : mosaico_envi.3, mosaico_envi.1, mosaico_envi.2,
mosaico_envi.4, mosaico_envi.5, mosaico_envi.6
min values  : NA, NA, NA, NA, NA, NA
max values  : NA, NA, NA, NA, NA, NA
class       : RasterBrick
dimensions  : 1486, 1162, 1726732, 6  (nrow, ncol, ncell, nlayers)
resolution  : 0.170881, 0.170881  (x, y)
extent      : 578587.4, 578785.9, 4722025, 4722279  (xmin, xmax, ymin, ymax)
coord. ref. : +proj=utm +zone=30 +ellps=GRS80 +units=m +no_defs
data source : /media/Iomega_HDD/UAVetal/vinedo/RNavarra/mosaico_enviv2.tif
names       : mosaico_enviv2.1, mosaico_enviv2.2, mosaico_enviv2.3,
mosaico_enviv2.4, mosaico_enviv2.5, mosaico_enviv2.6
min values  : 0, 0, 0, 0, 0, 0
max values  : 175, 224, 179, 199, 196, 204

But it is modified if I write to ENVI format:
class       : RasterBrick
dimensions  : 1486, 1162, 1726732, 6  (nrow, ncol, ncell, nlayers)
resolution  : 0.170881, 0.170881  (x, y)
extent      : 578587.4, 578785.9, 4722025, 4722279  (xmin, xmax, ymin, ymax)
coord. ref. : +proj=utm +zone=30 +datum=NAD27 +units=m +no_defs
+ellps=clrk66 +nadgrids=@conus, at alaska, at ntv2_0.gsb, at ntv1_can.dat
data source : /media/Iomega_HDD/UAVetal/vinedo/RNavarra/mosaico_enviv2.envi
names       : mosaico_enviv2.1, mosaico_enviv2.2, mosaico_enviv2.3,
mosaico_enviv2.4, mosaico_enviv2.5, mosaico_enviv2.6
min values  : 0, 0, 0, 0, 0, 0
max values  : 175, 224, 179, 199, 196, 204


Is this a bug in raster or rgdal, or am I doing something wrong?

Agus