[Gdal-dev] floating point bug

Frank Warmerdam warmerdam at pobox.com
Tue Jun 1 09:59:03 EDT 2004


Maciek Sieczka wrote:
> Frank,
> 
> Since the server is permanently down I decided to answer your question in
> person. If you don't want me to do it ever again please let me know. And
> sorry then!
 >
> BTW: do you know where is the list going to "get up" again?

Maciek,

No problem with the direct email (especially with sample data).  I have cc;ed
the list with my response so folks will know the resolution of the issue.
The list is back this morning.  Apparently the new machine hosting remotesensing.org
has memory problems, though I am not sure if that was responsible for the most
recent outage which seems to have also taken out imagelinks.com (ImageLinks it
the hosting organization).

> F> Sorry, I don't recall the details.  What that the one that was really a
> F> BIL file, and GDAL didn't support floating point BIL files?   That
> F> was resolved by assuming that 32bit files were floating point.  If it
> F> was really an arc/grid binary grid coverage, could you provide it
> F> again?
> 
> The problem with BIL occured "by the way" when I was trying to
> walkover my problem.
> 
> The MAIN issue is: FP ArcGrid support in GDAL is faulty IMHO.
> 
> below goes our most recent email on this subject
> a sample of the problematic file is attached
> 
> F>> I find it hard to believe that GDAL's AIG driver would misreport a
> F>> floating point Arc/Info Binary Grid as Int16.  If you can provide a
> F>> sample Arc/Info grid that demonstrates this problem I will investigate.
> 
> M> I digged a little more and I'm confused.
> 
> M> I noticed that whether GDAL recognises the FP ARCGrid as FP or INT
> M> depends somehow on the proportion and distribution of null/data
> M> cells in a file but I can't find a simple rule for this (and I may be
> M> wrong as well). Anyway if the FP grid file is "100% data" it is always
> M> recognised as FP. But if it contains nulls then GDAL will see it as INT
> M> or FP dependending on the file itself. Examples for both cases taken out
> M> from my FP ARCGrid are attached in the arc.tgz. If you need a bigger one
> M> please let me know. BOTH shold be FLOATING POINT while only
> M> ONE is recognised properly.

Thanks for the sample data.  These files are Arc/Info ASCII grids (not the
binary grids I thought we were talking about).

This is already a known issue in bug:

   http://bugzilla.remotesensing.org/show_bug.cgi?id=313

Basically I scan the first 1K or so of the file to look for floating point values.
If I don't find any I assume the whole coverage is integer.

I have been hesitant to "fix" this as a proper fix would seem to require
scanning the whole file on open which is pretty expensive.

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    | Geospatial Programmer for Rent




More information about the Gdal-dev mailing list