On 26/08/2011 16:33, Even Rouault wrote:
Selon Hermann Peifer<[email protected]>:

Hi,

Occasionally I use a small .asc file, which I then gdal_translate into a
bigger blank GeoTIFF. I tried to make the smallest possible test.asc
file with 1 col x 1 row and 1 cell value only, but I ended up with ERROR
4: file not recognised as a supported file format.

The error message seems to go away after adding (useless) values to the
file, see below.

I am wondering if this is a feature or rather a bug?

Feature/bug/hazard... who knows ;-) The test that identifies if a file is
AAIGRID first checks if there are at least 100 bytes in the file, which looks
like a rough estimate of the size taken by the minimum header lines and should
be fine for any sensible raster. I guess this test could be just killed since
the Identify() also checks the presence of one of the keywords. But you have
found the workaround, just add enough spaces at the end of your files and it
should be OK. Anyway you can create a ticket if you wish


Even,

Thanks for the explanation. Ticket created at http://trac.osgeo.org/gdal/ticket/4209.

For the time being, I just add more spaces into the header lines, like this example, which has just about enough bytes to get through the test:

ncols             1
nrows             1
xllcorner         0
yllcorner         0
cellsize          1
0


Hermann
_______________________________________________
gdal-dev mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/gdal-dev

Reply via email to