Skip to content

writeRaster with raster package

1 message · Ben

Ben
#
Hello,
I have a problem writing a raster with the raster package. 
I have the raster object "mask" which has the following geoinformation:
---- R output
class       : RasterLayer 
filename    :
E:/Daten/FE/HyMAP/Luxembourg_2010/Kehlen_Useldange/mosaik/LUX_LC_noOverlap_mask 
nrow        : 5198 
ncol        : 2813 
ncell       : 14621974 
min value   : 0 
max value   : 255 
projection  : +proj=utm +zone=31 +ellps=WGS84 +datum=WGS84 +units=m +no_defs
+towgs84=0,0,0 
extent      : 710938, 722190, 5501612, 5522404  (xmin, xmax, ymin, ymax)
resolution  : 4, 4  (x, y)
---

If I now use writeRaster to write the file in Envi format, the
geoinformation is lost for the object written to the file BUT not for the
object in the work space. The content in the file is correct but I do net
get the right header information about the geocoding.

---
class       : RasterLayer 
filename    :
E:/Daten/FE/HyMAP/Luxembourg_2010/Kehlen_Useldange/mosaik/refdata/mask.envi 
nrow        : 5198 
ncol        : 2813 
ncell       : 14621974 
min value   : 0 
max value   : 1 
projection  : +proj=utm +zone=31 +ellps=WGS84 +datum=WGS84 +units=m +no_defs
+towgs84=0,0,0 
extent      : 0, 2813, -5198, 0  (xmin, xmax, ymin, ymax)
resolution  : 1, 1  (x, y)
class       : RasterLayer 
filename    :
E:/Daten/FE/HyMAP/Luxembourg_2010/Kehlen_Useldange/mosaik/LUX_LC_noOverlap_mask 
nrow        : 5198 
ncol        : 2813 
ncell       : 14621974 
min value   : 0 
max value   : 255 
projection  : +proj=utm +zone=31 +ellps=WGS84 +datum=WGS84 +units=m +no_defs
+towgs84=0,0,0 
extent      : 710938, 722190, 5501612, 5522404  (xmin, xmax, ymin, ymax)
resolution  : 4, 4  (x, y)
---

Anybody knows what happens here and what can be done to fix that. 
Any help is highly appreciated!
Thanx in advance!
Ben