Skip to content

Issue saving ascii with writeRaster function

1 message · Robert J. Hijmans

#
Damien,

The default setting is to write Real numbers, hence the
1.000000000000000 (which is needed to trick GDAL and ESRI to not
assume that the values are all integers when the first numbers have no
decimals).
If you want integers, you can do

writeRaster(r, filename = "test.asc", datatype='INT4S')
NCOLS 2
NROWS 2
XLLCORNER -100
YLLCORNER -100
CELLSIZE 100
NODATA_value -9999
1 1
1 1

Best, Robert

On Thu, Jul 24, 2014 at 11:51 PM, Damien GEORGES
<damien.georges2 at gmail.com> wrote: