[Gdal-dev] Issues with gdal_translate / ASCII grid

Frank Warmerdam warmerdam at pobox.com
Thu Aug 23 09:42:23 EDT 2007


Kor de Jong wrote:
> 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.

Kor,

The AAIGDataset::Open() method has a check that the passed in header chunk
is at least 100 characters.   I suspect that your test files with integers
are slightly smaller than this ... is that possible?

I don't think there is any particular reason for this test and I imagine
it could be removed or reduced.  Feel free to make careful adjustments in:

  gdal/frmts/aaigrid/aaigriddataset.cpp.

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | President OSGeo, http://osgeo.org




More information about the Gdal-dev mailing list