[Gdal-dev] Issues with gdal_translate / ASCII grid

Kor de Jong k.dejong at geo.uu.nl
Thu Aug 23 06:06:35 EDT 2007


Hi all,

I am creating some raster files using the gdal_translate command. I
create an ASCII grid file and translate them into the PCRaster raster
format. Depending on the actual values in the ASCII grid gdal_translate
succeeds or fails. In short, an input grid with 1's fails and one with
1.0's and 10's succeeds.

Below are the inputs, the commands and the messages.
Also, reading an ASCII grid file fails if the cell size does not contain
a decimal point.

I can work around this by using different values, or adding a decimal
point to the values. Just wanted to let you know about it.

Best regards,
Kor



$ cat values.col
NCOLS 2
NROWS 3
XLLCORNER 100000.0
YLLCORNER 199850.0
CELLSIZE 50.0
NODATA_VALUE 1e31
10 10
10 10
10 10
$ gdal_translate -ot Float32 -mo "PCRASTER_VALUESCALE=VS_SCALAR" -of PCRaster 
values.col values.map
Input file size is 2, 3
3366100 - done.
$



$ cat values.col
NCOLS 2
NROWS 3
XLLCORNER 100000.0
YLLCORNER 199850.0
CELLSIZE 50.0
NODATA_VALUE 1e31
1 1
1 1
1 1
$ gdal_translate -ot Float32 -mo "PCRASTER_VALUESCALE=VS_SCALAR" -of PCRaster 
values.col values.map
ERROR 4: `values.col' not recognised as a supported file format.

GDALOpen failed - 4
`values.col' not recognised as a supported file format.
$



$ cat values.col
NCOLS 2
NROWS 3
XLLCORNER 100000
YLLCORNER 199850
CELLSIZE 50.0
NODATA_VALUE 1e31
1.0 1.0
1.0 1.0
1.0 1.0
$ gdal_translate -ot Float32 -mo "PCRASTER_VALUESCALE=VS_SCALAR" -of PCRaster 
values.col values.map
Input file size is 2, 3
3366100 - done.


-- 
Kor de Jong, k.dejong at geo.uu.nl
Fysische Geografie, Geowetenschappen, Universiteit Utrecht




More information about the Gdal-dev mailing list