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

Even Rouault even.rouault at mines-paris.org
Fri Oct 19 13:43:37 PDT 2012


Le vendredi 19 octobre 2012 22:23:49, Peter Willis a écrit :
> Hello,
> 
> I am providing the failed example followed by a working example.
> Let me know if there is any additional information you need.

With both headers, gdalinfo correctly reports the nodata value... But you 
didn't send the .hdr files you've generated since the "data ignore value" is 
not at their end.

> 
> Thanks,
> 
> Peter
> 
> 
> ------The Failed Header Sample------
> ENVI
> description = {
> /web2-disk1/PR762/landsat/cubes/96_98/LSatThermalCube_96-98_float_cmsk_land
> m asked_ll.img}
> samples = 2178
> lines   = 1841
> bands   = 49
> header offset = 0
> file type = ENVI Standard
> data type = 4
> interleave = bsq
> byte order = 0
> map info = {Geographic Lat/Lon, 1, 1, -124.258818822249, 51.6708415299984,
> 0.000337173258151718, 0.000337173258151718,WGS-84}
> wavelength units = Unknown
> data ignore value = -9.99000000e+002
> band names = {
> Band 1,
> Band 2,
> Band 3,
> Band 4,
> Band 5,
> Band 6,
> Band 7,
> Band 8,
> Band 9,
> Band 10,
> Band 11,
> Band 12,
> Band 13,
> Band 14,
> Band 15,
> Band 16,
> Band 17,
> Band 18,
> Band 19,
> Band 20,
> Band 21,
> Band 22,
> Band 23,
> Band 24,
> Band 25,
> Band 26,
> Band 27,
> Band 28,
> Band 29,
> Band 30,
> Band 31,
> Band 32,
> Band 33,
> Band 34,
> Band 35,
> Band 36,
> Band 37,
> Band 38,
> Band 39,
> Band 40,
> Band 41,
> Band 42,
> Band 43,
> Band 44,
> Band 45,
> Band 46,
> Band 47,
> Band 48,
> Band 49}
> 
> 
> 
> ------The Working Header Sample------
> 
> ENVI
> description = {
>   Band Math Result, Expression = [(float(b2 gt 0.0) * b1) + (float(b2 eq
> 0.0)*
>   (-999.0))] B1:LSatThermalCube_96-98_float_cmsk.img
>   B2:LSatThermalCube_96-98_float_cmsk_multi_channel_mask.img [Thu Oct 18
>   10:12:05 2012]}
> samples = 1677
> lines   = 2281
> bands   = 49
> header offset = 0
> file type = ENVI Standard
> data type = 4
> interleave = bsq
> sensor type = Unknown
> byte order = 0
> map info = {UTM, 1.000, 1.000, 412940.000, 5724563.000, 3.0000000000e+001,
> 3.0000000000e+001, 10, North, WGS-84, units=Meters}
> wavelength units = Unknown
> data ignore value = -9.99000000e+002
> pixel size = {3.00000000e+001, 3.00000000e+001, units=Meters}
> band names = {
>  Band Math (Band Math (Band Math (1996_088 Landsat-4/5 TM :Surface
> Temperature
> Sensor:6:LSatThermalCube_96-98.img):LSatThermalCube_96-98_float.img):LSatTh
> e rmalCube_96-98_float_cmsk.img),
>  Band Math (Band Math (Band Math (1996_104 Landsat-4/5 TM :Surface
> Temperature
> Sensor:6:LSatThermalCube_96-98.img):LSatThermalCube_96-98_float.img):LSatTh
> e rmalCube_96-98_float_cmsk.img),
>  Band Math (Band Math (Band Math (1996_111 Landsat-4/5 TM :Surface
> Temperature
> Sensor:6:LSatThermalCube_96-98.img):LSatThermalCube_96-98_float.img):LSatTh
> e rmalCube_96-98_float_cmsk.img),
>  Band Math (Band Math (Band Math (1996_120 Landsat-4/5 TM :Surface
> Temperature
> Sensor:6:LSatThermalCube_96-98.img):LSatThermalCube_96-98_float.img):LSatTh
> e rmalCube_96-98_float_cmsk.img),
>  Band Math (Band Math (Band Math (1996_136 Landsat-4/5 TM :Surface
> Temperature
> Sensor:6:LSatThermalCube_96-98.img):LSatThermalCube_96-98_float.img):LSatTh
> e rmalCube_96-98_float_cmsk.img),
>  Band Math (Band Math (Band Math (1996_152 Landsat-4/5 TM :Surface
> Temperature
> Sensor:6:LSatThermalCube_96-98.img):LSatThermalCube_96-98_float.img):LSatTh
> e rmalCube_96-98_float_cmsk.img),
>  Band Math (Band Math (Band Math (1996_159 Landsat-4/5 TM :Surface
> Temperature
> Sensor:6:LSatThermalCube_96-98.img):LSatThermalCube_96-98_float.img):LSatTh
> e rmalCube_96-98_float_cmsk.img),
>  Band Math (Band Math (Band Math (1996_168 Landsat-4/5 TM :Surface
> Temperature
> Sensor:6:LSatThermalCube_96-98.img):LSatThermalCube_96-98_float.img):LSatTh
> e rmalCube_96-98_float_cmsk.img),
>  Band Math (Band Math (Band Math (1996_191 Landsat-4/5 TM :Surface
> Temperature
> Sensor:6:LSatThermalCube_96-98.img):LSatThermalCube_96-98_float.img):LSatTh
> e rmalCube_96-98_float_cmsk.img),
>  Band Math (Band Math (Band Math (1996_200 Landsat-4/5 TM :Surface
> Temperature
> Sensor:6:LSatThermalCube_96-98.img):LSatThermalCube_96-98_float.img):LSatTh
> e rmalCube_96-98_float_cmsk.img),
>  Band Math (Band Math (Band Math (1996_207 Landsat-4/5 TM :Surface
> Temperature
> Sensor:6:LSatThermalCube_96-98.img):LSatThermalCube_96-98_float.img):LSatTh
> e rmalCube_96-98_float_cmsk.img),
>  Band Math (Band Math (Band Math (1996_216 Landsat-4/5 TM :Surface
> Temperature
> Sensor:6:LSatThermalCube_96-98.img):LSatThermalCube_96-98_float.img):LSatTh
> e rmalCube_96-98_float_cmsk.img),
>  Band Math (Band Math (Band Math (1996_223 Landsat-4/5 TM :Surface
> Temperature
> Sensor:6:LSatThermalCube_96-98.img):LSatThermalCube_96-98_float.img):LSatTh
> e rmalCube_96-98_float_cmsk.img),
>  Band Math (Band Math (Band Math (1996_232 Landsat-4/5 TM :Surface
> Temperature
> Sensor:6:LSatThermalCube_96-98.img):LSatThermalCube_96-98_float.img):LSatTh
> e rmalCube_96-98_float_cmsk.img),
>  Band Math (Band Math (Band Math (1996_239 Landsat-4/5 TM :Surface
> Temperature
> Sensor:6:LSatThermalCube_96-98.img):LSatThermalCube_96-98_float.img):LSatTh
> e rmalCube_96-98_float_cmsk.img),
>  Band Math (Band Math (Band Math (1996_255 Landsat-4/5 TM :Surface
> Temperature
> Sensor:6:LSatThermalCube_96-98.img):LSatThermalCube_96-98_float.img):LSatTh
> e rmalCube_96-98_float_cmsk.img),
>  Band Math (Band Math (Band Math (1996_280 Landsat-4/5 TM :Surface
> Temperature
> Sensor:6:LSatThermalCube_96-98.img):LSatThermalCube_96-98_float.img):LSatTh
> e rmalCube_96-98_float_cmsk.img),
>  Band Math (Band Math (Band Math (1996_303 Landsat-4/5 TM :Surface
> Temperature
> Sensor:6:LSatThermalCube_96-98.img):LSatThermalCube_96-98_float.img):LSatTh
> e rmalCube_96-98_float_cmsk.img),
>  Band Math (Band Math (Band Math (1997_097 Landsat-4/5 TM :Surface
> Temperature
> Sensor:6:LSatThermalCube_96-98.img):LSatThermalCube_96-98_float.img):LSatTh
> e rmalCube_96-98_float_cmsk.img),
>  Band Math (Band Math (Band Math (1997_106 Landsat-4/5 TM :Surface
> Temperature
> Sensor:6:LSatThermalCube_96-98.img):LSatThermalCube_96-98_float.img):LSatTh
> e rmalCube_96-98_float_cmsk.img),
>  Band Math (Band Math (Band Math (1997_122 Landsat-4/5 TM :Surface
> Temperature
> Sensor:6:LSatThermalCube_96-98.img):LSatThermalCube_96-98_float.img):LSatTh
> e rmalCube_96-98_float_cmsk.img),
>  Band Math (Band Math (Band Math (1997_129 Landsat-4/5 TM :Surface
> Temperature
> Sensor:6:LSatThermalCube_96-98.img):LSatThermalCube_96-98_float.img):LSatTh
> e rmalCube_96-98_float_cmsk.img),
>  Band Math (Band Math (Band Math (1997_145 Landsat-4/5 TM :Surface
> Temperature
> Sensor:6:LSatThermalCube_96-98.img):LSatThermalCube_96-98_float.img):LSatTh
> e rmalCube_96-98_float_cmsk.img),
>  Band Math (Band Math (Band Math (1997_161 Landsat-4/5 TM :Surface
> Temperature
> Sensor:6:LSatThermalCube_96-98.img):LSatThermalCube_96-98_float.img):LSatTh
> e rmalCube_96-98_float_cmsk.img),
>  Band Math (Band Math (Band Math (1997_170 Landsat-4/5 TM :Surface
> Temperature
> Sensor:6:LSatThermalCube_96-98.img):LSatThermalCube_96-98_float.img):LSatTh
> e rmalCube_96-98_float_cmsk.img),
>  Band Math (Band Math (Band Math (1997_177 Landsat-4/5 TM :Surface
> Temperature
> Sensor:6:LSatThermalCube_96-98.img):LSatThermalCube_96-98_float.img):LSatTh
> e rmalCube_96-98_float_cmsk.img),
>  Band Math (Band Math (Band Math (1997_193 Landsat-4/5 TM :Surface
> Temperature
> Sensor:6:LSatThermalCube_96-98.img):LSatThermalCube_96-98_float.img):LSatTh
> e rmalCube_96-98_float_cmsk.img),
>  Band Math (Band Math (Band Math (1997_209 Landsat-4/5 TM :Surface
> Temperature
> Sensor:6:LSatThermalCube_96-98.img):LSatThermalCube_96-98_float.img):LSatTh
> e rmalCube_96-98_float_cmsk.img),
>  Band Math (Band Math (Band Math (1997_218 Landsat-4/5 TM :Surface
> Temperature
> Sensor:6:LSatThermalCube_96-98.img):LSatThermalCube_96-98_float.img):LSatTh
> e rmalCube_96-98_float_cmsk.img),
>  Band Math (Band Math (Band Math (1997_225 Landsat-4/5 TM :Surface
> Temperature
> Sensor:6:LSatThermalCube_96-98.img):LSatThermalCube_96-98_float.img):LSatTh
> e rmalCube_96-98_float_cmsk.img),
>  Band Math (Band Math (Band Math (1997_234 Landsat-4/5 TM :Surface
> Temperature
> Sensor:6:LSatThermalCube_96-98.img):LSatThermalCube_96-98_float.img):LSatTh
> e rmalCube_96-98_float_cmsk.img),
>  Band Math (Band Math (Band Math (1997_250 Landsat-4/5 TM :Surface
> Temperature
> Sensor:6:LSatThermalCube_96-98.img):LSatThermalCube_96-98_float.img):LSatTh
> e rmalCube_96-98_float_cmsk.img),
>  Band Math (Band Math (Band Math (1997_266 Landsat-4/5 TM :Surface
> Temperature
> Sensor:6:LSatThermalCube_96-98.img):LSatThermalCube_96-98_float.img):LSatTh
> e rmalCube_96-98_float_cmsk.img),
>  Band Math (Band Math (Band Math (1998_077 Landsat-4/5 TM :Surface
> Temperature
> Sensor:6:LSatThermalCube_96-98.img):LSatThermalCube_96-98_float.img):LSatTh
> e rmalCube_96-98_float_cmsk.img),
>  Band Math (Band Math (Band Math (1998_093 Landsat-4/5 TM :Surface
> Temperature
> Sensor:6:LSatThermalCube_96-98.img):LSatThermalCube_96-98_float.img):LSatTh
> e rmalCube_96-98_float_cmsk.img),
>  Band Math (Band Math (Band Math (1998_109 Landsat-4/5 TM :Surface
> Temperature
> Sensor:6:LSatThermalCube_96-98.img):LSatThermalCube_96-98_float.img):LSatTh
> e rmalCube_96-98_float_cmsk.img),
>  Band Math (Band Math (Band Math (1998_125 Landsat-4/5 TM :Surface
> Temperature
> Sensor:6:LSatThermalCube_96-98.img):LSatThermalCube_96-98_float.img):LSatTh
> e rmalCube_96-98_float_cmsk.img),
>  Band Math (Band Math (Band Math (1998_132 Landsat-4/5 TM :Surface
> Temperature
> Sensor:6:LSatThermalCube_96-98.img):LSatThermalCube_96-98_float.img):LSatTh
> e rmalCube_96-98_float_cmsk.img),
>  Band Math (Band Math (Band Math (1998_141 Landsat-4/5 TM :Surface
> Temperature
> Sensor:6:LSatThermalCube_96-98.img):LSatThermalCube_96-98_float.img):LSatTh
> e rmalCube_96-98_float_cmsk.img),
>  Band Math (Band Math (Band Math (1998_148 Landsat-4/5 TM :Surface
> Temperature
> Sensor:6:LSatThermalCube_96-98.img):LSatThermalCube_96-98_float.img):LSatTh
> e rmalCube_96-98_float_cmsk.img),
>  Band Math (Band Math (Band Math (1998_157 Landsat-4/5 TM :Surface
> Temperature
> Sensor:6:LSatThermalCube_96-98.img):LSatThermalCube_96-98_float.img):LSatTh
> e rmalCube_96-98_float_cmsk.img),
>  Band Math (Band Math (Band Math (1998_164 Landsat-4/5 TM :Surface
> Temperature
> Sensor:6:LSatThermalCube_96-98.img):LSatThermalCube_96-98_float.img):LSatTh
> e rmalCube_96-98_float_cmsk.img),
>  Band Math (Band Math (Band Math (1998_189 Landsat-4/5 TM :Surface
> Temperature
> Sensor:6:LSatThermalCube_96-98.img):LSatThermalCube_96-98_float.img):LSatTh
> e rmalCube_96-98_float_cmsk.img),
>  Band Math (Band Math (Band Math (1998_205 Landsat-4/5 TM :Surface
> Temperature
> Sensor:6:LSatThermalCube_96-98.img):LSatThermalCube_96-98_float.img):LSatTh
> e rmalCube_96-98_float_cmsk.img),
>  Band Math (Band Math (Band Math (1998_212 Landsat-4/5 TM :Surface
> Temperature
> Sensor:6:LSatThermalCube_96-98.img):LSatThermalCube_96-98_float.img):LSatTh
> e rmalCube_96-98_float_cmsk.img),
>  Band Math (Band Math (Band Math (1998_221 Landsat-4/5 TM :Surface
> Temperature
> Sensor:6:LSatThermalCube_96-98.img):LSatThermalCube_96-98_float.img):LSatTh
> e rmalCube_96-98_float_cmsk.img),
>  Band Math (Band Math (Band Math (1998_260 Landsat-4/5 TM :Surface
> Temperature
> Sensor:6:LSatThermalCube_96-98.img):LSatThermalCube_96-98_float.img):LSatTh
> e rmalCube_96-98_float_cmsk.img),
>  Band Math (Band Math (Band Math (1998_269 Landsat-4/5 TM :Surface
> Temperature
> Sensor:6:LSatThermalCube_96-98.img):LSatThermalCube_96-98_float.img):LSatTh
> e rmalCube_96-98_float_cmsk.img),
>  Band Math (Band Math (Band Math (1998_292 Landsat-4/5 TM :Surface
> Temperature
> Sensor:6:LSatThermalCube_96-98.img):LSatThermalCube_96-98_float.img):LSatTh
> e rmalCube_96-98_float_cmsk.img)}
> coordinate system string = {
>  PROJCS["UTM_Zone_10N", GEOGCS["GCS_WGS_1984", DATUM["D_WGS_1984",
>  SPHEROID["WGS_1984", 6378137.0, 298.257223563]], PRIMEM["Greenwich", 0.0],
>  UNIT["Degree", 0.0174532925199433]], PROJECTION["Transverse_Mercator"],
>  PARAMETER["False_Easting", 500000.0], PARAMETER["False_Northing", 0.0],
>  PARAMETER["Central_Meridian", -123.0], PARAMETER["Scale_Factor", 0.9996],
>  PARAMETER["Latitude_Of_Origin", 0.0], UNIT["Meter", 1.0]]}
> 
> 
> 
> 
> 
> 
> -----Original Message-----
> From: Even Rouault [mailto:even.rouault at mines-paris.org]
> Sent: October-19-12 11:53 AM
> To: gdal-dev at lists.osgeo.org
> Cc: Peter Willis
> Subject: Re: [gdal-dev] gdalinfo -stats Misses invalid data value in ENVI
> header
> 
> 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