[R] writeRaster with raster package

ben benjamin0mack at gmail.com
Mon Jan 24 13:17:35 CET 2011


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
> mask
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.

---
> writeRaster(mask,"mask", format="ENVI")
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)

> mask
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


-- 
View this message in context: http://r.789695.n4.nabble.com/writeRaster-with-raster-package-tp3233871p3233871.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list