[gdal-dev] gdalinfo -stats Misses invalid data value in ENVI header

Even Rouault even.rouault at mines-paris.org
Fri Oct 19 11:52:50 PDT 2012


Le vendredi 19 octobre 2012 20:41:16, Peter Willis a écrit :
> Hello,
> 
> I have a curious problem with 'gdalinfo'   (gdal version 1.9.0 ).
> 
> I have an input ENVI file with the following .HDR entry:
> 
>  data ignore value = -9.99000000e+002
> 
> gdalinfo for the IMG file provides stats that exclude all values  -999.0 as
> expected.
> 
> I then create a masked output file using 'gdal_rasterize' from that input
> file once again using -999.0 as the mask value.
> 'gdal_rasterize' produces an ENVI format output with an accompanying .HDR
> file.

There's indeed no support currently in the ENVI driver to write the "data 
ignore value" field.

> 
> The resulting 'gdal_rasterize' HDR  *does not* contain the previous 'data
> ignore value'  entry. This is something that should
> be fixed in future versions of that utility. The work around is, of course,
> to simply concatenate the 'data ignore value'
> to the end of the HDR file. This is a quick step:
> 
> echo ""  >> myfile.hdr
> echo "data ignore value = -9.99000000+e2"  >> myfile.hdr
> echo ""  >> myfile.hdr

I've tried that and this worked for me. Perhaps you could send your myfile.hdr 
?


More information about the gdal-dev mailing list