Dear Researchers,

I am using the function rasterize to create a map with mean value and NAvalue
pixel (where I have no points), I saved two format GeoTif and ASCII but
after open in ArcMap in the ASCII file the NAvalue pixel are - 3 (and not
NODATA ) as the TIF format (always in Arcmap). I tried to set up for both
images NAflag=-9999.

thanks in advance
Gianni

Mydata  <- read.delim("Mydata.txt", sep=",",header=TRUE)
coordinates(Mydata) =~X+Y
r = raster(extent(Mydata))
res(r) = 0.5
r.mean <- rasterize(Mydata, r, 'Z', fun=mean)
NAvalue(r.mean)
[1] -3.4e+38

rt <- writeRaster(r.mean, filename="MeanHeigh.tif", format="GTiff",
overwrite=TRUE, NAflag=-9999)
rt
class       : RasterLayer
dimensions  : 1659, 2810, 4661790  (nrow, ncol, ncell)
resolution  : 0.5, 0.5  (x, y)
extent      : 267586.6, 268991.6, 4147061, 4147890  (xmin, xmax, ymin, ymax)
projection  : NA
values      : C:/MySAMPLE/MeanHeigh.tif
min value   : 1332.69
max value   : 1744.35


rt <- writeRaster (r.mean, "MEANHeigh.asc", format="ascii", overwrite=T,
datatype="INT4S",NAflag=-9999)
rt
class       : RasterLayer
dimensions  : 1659, 2810, 4661790  (nrow, ncol, ncell)
resolution  : 0.5, 0.5  (x, y)
extent      : 267586.6, 268991.6, 4147061, 4147890  (xmin, xmax, ymin, ymax)
projection  : NA
values      : C:/MYSAMPLE/MeanHeigh.asc
*min value   : -3 *
max value   : 1744

	[[alternative HTML version deleted]]

