[Gdal-dev] gdalwarp HFA color problem

Markus Neteler neteler at itc.it
Tue Oct 26 17:02:56 EDT 2004


On Tue, Oct 26, 2004 at 01:50:40PM -0400, Frank Warmerdam wrote:
> Markus Neteler wrote:
> >Hi,
> >
> >when using 'gdalwarp' on a HFA image with a large
> >color table, the resulting file get's a corrupted
> >colot tbale (almost white):
> >
> >gdalinfo hanoi_lsat7_brovey_UTM48N.img | grep   'Color Table'
> >  Color Table (RGB with 32764 entries)
> >
> >gdalwarp -of HFA -t_srs '+init=epsg:4326'  hanoi_lsat7_brovey_UTM48N.img 
> >hanoi_lsat7_brovey_LL.img
> >Creating output file is that 9404P x 5964L.
> >:0...10...20...30...40...50...60...70...80...90...100 - done.
> 
> Markus,
> 
> I have done a number of changes in the GDAL HFA driver now that correct this
> and some related problems.  If you get a chance please try from CVS and let 
> me know if it still fails.

Frank,
thanks for the quick response. I did an complete recompilation, but still
no luck. However, some changes now:

gdalwarp -of HFA -t_srs '+init=epsg:4326' hanoi_lsat7_brovey_UTM48N.img hanoi_lsat7_brovey_LL.img
Creating output file is that 9404P x 5964L.
:0...10...20...30...40...50...60...70...80...90...100 - done.

gdalinfo  hanoi_lsat7_brovey_LL.img
Driver: HFA/Erdas Imagine Images (.img)
Size is 9404, 5964
Coordinate System is:
GEOGCS["WGS_1984",
    DATUM["WGS_1984",
        SPHEROID["WGS 84",6378137,298.2572235629972],
        TOWGS84[0,0,0,0,0,0,0]],
    PRIMEM["Greenwich",0],
    UNIT["degree",0.0174532925199433]]
Origin = (105.072584,21.537953)
Pixel Size = (0.00013460,-0.00013460)
Corner Coordinates:
Upper Left  ( 105.0725836,  21.5379527) (105d 4'21.30"E, 21d32'16.63"N)
Lower Left  ( 105.0725836,  20.7351738) (105d 4'21.30"E, 20d44'6.63"N)
Upper Right ( 106.3384006,  21.5379527) (106d20'18.24"E, 21d32'16.63"N)
Lower Right ( 106.3384006,  20.7351738) (106d20'18.24"E, 20d44'6.63"N)
Center      ( 105.7054921,  21.1365633) (105d42'19.77"E, 21d 8'11.63"N)
Band 1 Block=64x64 Type=Int16, ColorInterp=Palette
  Color Table (RGB with 32764 entries)
    0: 0,0,0,255
    1: 6,0,0,255
    2: 14,0,0,255
[... now long table with 32764 entires, was 256 before, but: ]
  252: 230,57,0,255
  253: 238,57,0,255
  254: 246,57,0,255
  255: 255,57,0,255
  256: 0,0,0,0
  257: 0,0,0,0
  258: 0,0,0,0
  259: 0,0,0,0
  260: 0,0,0,0
...
  31897: 0,0,0,0
  31898: 0,0,0,0
  31899: 0,0,0,0
  31900: 0,0,0,0
  31901: 7171,0,0,0
  31902: -509,0,0,0
  31903: 1066,0,0,0
  31904: 3971,0,0,0
  31905: -32768,0,0,0
  31906: 0,0,0,0
  31907: 0,0,0,0
...
  32751: 0,0,0,0
  32752: 0,0,0,0
  32753: 0,0,0,0
  32754: 7186,0,0,0
  32755: 680,0,0,0
  32756: 7171,0,0,0
  32757: 0,0,0,0
  32758: 534,0,0,0
  32759: 0,0,0,0
  32760: 557,0,0,0
  32761: 1092,0,0,0
  32762: 555,0,0,0
  32763: -509,0,0,0


There is still something not reaching the new color table as
the resulting image appears almost black.

And
gdalwarp -t_srs '+init=epsg:4326' hanoi_lsat7_brovey_UTM48N.img hanoi_lsat7_brovey_LL.tif
Creating output file is that 1482P x 2770L.
Segmentation fault

as before (in GDALSetRasterColorTable(), GDALWarpCreateOutput()).

If I should upload this file somewhere please let me know.
Otherwise it is still in the web site as indicated in the previous
mail.

Thanks again and sorry for now better news

 Markus




More information about the Gdal-dev mailing list