[Gdal-dev] Having problems with gdaladdo

Steven Bowden steveb at bundaberg.qld.gov.au
Thu Oct 13 18:32:06 EDT 2005


Hi List,

I am relatively new to using gdal to process my orthophotos.  I am using 
mapserver to publish the orthos in a web app.

I am trying to use gdaladdo to create the overviews for the tif files but I am 
getting some strange results in the tif files after I have created the 
overviews.  The second last overview is corrupted and the last/smallest 
overview always has a yellow square in the bottom right right hand corner of 
the image.

I am using gdal 1.3.1 and gd 2.0.33.

The source tif files that I am using are uncompressed non-GeoTiff files so I 
have created a .wld file so that gdal can create a geotiff.
Here is the gdal-info results for  the source file:
Driver: GTiff/GeoTIFF
Size is 1436, 3083
Coordinate System is `'
Origin = (428440.494370,7242335.759860)
Pixel Size = (0.15000000,-0.15000000)
Corner Coordinates:
Upper Left  (  428440.494, 7242335.760)
Lower Left  (  428440.494, 7241873.310)
Upper Right (  428655.894, 7242335.760)
Lower Right (  428655.894, 7241873.310)
Center      (  428548.194, 7242104.535)
Band 1 Block=256x256 Type=Byte, ColorInterp=Red
Band 2 Block=256x256 Type=Byte, ColorInterp=Green
Band 3 Block=256x256 Type=Byte, ColorInterp=Blue

We also use a commercial GIS product called GenaMap and here is what it 
reports on the source image:
Image name  : img27-2.tif
Format      : tiff
Size        : 1436 x 3083
Depth       : 8 (unsigned)
Bands       : 3 (bip layout)
Storage     : tiles of 256 x 256
Compression : none

I then run the following gdal commands:
gdal_translate -of GTiff -a_srs EPSG:28356 -co "INTERLEAVE=PIXEL" -co 
"TILED=YES" -co "PROFILE=GeoTIFF" img27-2.tif tmpfile.tif
mv tmpfile.tif img27-2.tif
gdaladdo -r average img27-2.tif 2 4 6 8 10 12 16

The results of the gdal-info now show:
Driver: GTiff/GeoTIFF
Size is 1436, 3083
Coordinate System is:
PROJCS["GDA94 / MGA zone 56",
    GEOGCS["GDA94",
        DATUM["Geocentric_Datum_of_Australia_1994",
            SPHEROID["GRS 1980",6378137,298.2572221010042,
                AUTHORITY["EPSG","7019"]],
            AUTHORITY["EPSG","6283"]],
        PRIMEM["Greenwich",0],
        UNIT["degree",0.0174532925199433],
        AUTHORITY["EPSG","4283"]],
    PROJECTION["Transverse_Mercator"],
    PARAMETER["latitude_of_origin",0],
    PARAMETER["central_meridian",153],
    PARAMETER["scale_factor",0.9996],
    PARAMETER["false_easting",500000],
    PARAMETER["false_northing",10000000],
    UNIT["metre",1,
        AUTHORITY["EPSG","9001"]],
    AUTHORITY["EPSG","28356"]]
Origin = (428440.494370,7242335.759860)
Pixel Size = (0.15000000,-0.15000000)
Metadata:
  AREA_OR_POINT=Area
Corner Coordinates:
Upper Left  (  428440.494, 7242335.760) (152d17'28.52"E, 24d55'57.13"S)
Lower Left  (  428440.494, 7241873.310) (152d17'28.43"E, 24d56'12.17"S)
Upper Right (  428655.894, 7242335.760) (152d17'36.20"E, 24d55'57.17"S)
Lower Right (  428655.894, 7241873.310) (152d17'36.11"E, 24d56'12.20"S)
Center      (  428548.194, 7242104.535) (152d17'32.31"E, 24d56'4.67"S)
Band 1 Block=256x256 Type=Byte, ColorInterp=Red
  Overviews: 718x1542, 359x771, 240x514, 180x386, 144x309, 120x257, 90x193
Band 2 Block=256x256 Type=Byte, ColorInterp=Green
  Overviews: 718x1542, 359x771, 240x514, 180x386, 144x309, 120x257, 90x193
Band 3 Block=256x256 Type=Byte, ColorInterp=Blue
  Overviews: 718x1542, 359x771, 240x514, 180x386, 144x309, 120x257, 90x193

and the GenaMap results:
Image name  : img27-2.tif
Format      : tiff
Size        : 1436 x 3083
Depth       : 8 (unsigned)
Bands       : 3 (bip layout)
Storage     : tiles of 256 x 256
Compression : none

I then use tiffsplit to split out the overviews for checking and converted 
them to jpegs for the purposes of display.

As you can see the 2nd last overview (xaag.jpg) isn't complete and the last 
overview (xaah.jpg) has the yellow at the bottom of the image.  I get the 
same results even if I drop the number of overviews to 4 (2 4 8 16).

This problem isn't just related to this image, it is visible in all 100 tiles 
of my mosaic.  Could this be due to a problem with my source images?  The 
source images are viewable ok through gimp/mapserver and all other image 
viewers.  I can make the source image availabe if needs be.

Any info and advice would be greatly appreciated.
Regards
Steve
-------------- next part --------------
A non-text attachment was scrubbed...
Name: xaag.jpg
Type: image/jpeg
Size: 8117 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/gdal-dev/attachments/20051014/055d5cd6/xaag.jpg
-------------- next part --------------
A non-text attachment was scrubbed...
Name: xaah.jpg
Type: image/jpeg
Size: 6372 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/gdal-dev/attachments/20051014/055d5cd6/xaah.jpg


More information about the Gdal-dev mailing list