Skip to content
Prev 23486 / 29559 Next

problems for reading ASCII file

On Wed, Oct 7, 2015 at 10:04 AM, Paulo Flores Ribeiro
<paulo.flores.mail at gmail.com> wrote:
How is that going to do anything but break the geolocation of the raster?

I'm worried about the comma decimal separators. Are they really commas
in the grid file? They should be full stops "." - otherwise I suspect
readAsciiGrid is throwing a fit. The cellsize parameter is a single
value, Esri Ascii Grid cells are always square.

Its possible there are decimal points okay in the file, and what
you've shown us is a localised printout where your locale is set to
use commas for decimal markers. But if there really are commas in the
file, then it will fail until they are replaced with points.

I can replicate your error with:

ncols 5
nrows 3
xllcorner 1000
yllcorner 1000
cellsize 0,001
NODATA_value -9999
2 3 4 3 2
3 4 5 6 7
1 2 4 3 2

and if I replace the comma with a point it reads in okay.

Barry