[gdal-dev] Problematic TIFs

Rob gis at vanbooth.com
Mon Apr 21 09:51:11 EDT 2008


I'm currently supporting a system that has some performance issues.  It
seems like the overviewed rasters have been replaced by some non over-viewed
rasters, so I want to try and add some overviews to improve performance.
However, disk space is at a premium, so I am trying to do it in a space
efficient way as well.

The TIFs at the moment average around 5-7Mb each.  I currently have a total
of 100Gb of files.  I'm using them in a system powered by MapServer, and
whilst they all display, the performance is poor.

A GDALINFO report gives the following kind of information -

>gdalinfo TQ00.TIF
Driver: GTiff/GeoTIFF
Size is 4000, 4000
Coordinate System is `'
Metadata:
  TIFFTAG_XRESOLUTION=254
  TIFFTAG_YRESOLUTION=254
  TIFFTAG_RESOLUTIONUNIT=2 (pixels/inch)
Corner Coordinates:
Upper Left  (    0.0,    0.0)
Lower Left  (    0.0, 4000.0)
Upper Right ( 4000.0,    0.0)
Lower Right ( 4000.0, 4000.0)
Center      ( 2000.0, 2000.0)
Band 1 Block=4000x8 Type=Byte, ColorInterp=Red
Band 2 Block=4000x8 Type=Byte, ColorInterp=Green
Band 3 Block=4000x8 Type=Byte, ColorInterp=Blue
Band 4 Block=4000x8 Type=Byte, ColorInterp=Alpha

If I try and add an overview to these files (file copied to maintain the
original), I get screens of error messages

gdaladdo TQ00ov.TIF 2 4 8 16
0.ERROR 1: MissingRequired:TQ00ov.TIF: TIFF directory is missing required
"Colormap" field
ERROR 1: MissingRequired:TQ00ov.TIF: TIFF directory is missing required
"Colormap" field
ERROR 1: MissingRequired:TQ00ov.TIF: TIFF directory is missing required
"Colormap" field
ERROR 1: MissingRequired:TQ00ov.TIF: TIFF directory is missing required
"Colormap" field
ERROR 1: MissingRequired:TQ00ov.TIF: TIFF directory is missing required
"Colormap" field
ERROR 1: MissingRequired:TQ00ov.TIF: TIFF directory is missing required
"Colormap" field
ERROR 1: MissingRequired:TQ00ov.TIF: TIFF directory is missing required
"Colormap" field
etc..

If I try and translate the original first, I get the following error
messages

gdal_translate -ot Byte -of GTiff -co "TILED=YES" TQ00tif.TIF TQ00tiled.TIF
Input file size is 4000, 4000
0...10...20...30...ERROR 1: TIFFAppendToStrip:TQ00tiled.TIF: Write error at
scanline 3072
ERROR 1: TIFFAppendToStrip:TQ00tiled.TIF: Write error at scanline 3072
ERROR 1: TIFFAppendToStrip:TQ00tiled.TIF: Write error at scanline 3328
ERROR 1: TIFFAppendToStrip:TQ00tiled.TIF: Write error at scanline 3328
ERROR 1: TIFFAppendToStrip:TQ00tiled.TIF: Write error at scanline 3584
ERROR 1: TIFFAppendToStrip:TQ00tiled.TIF: Write error at scanline 3584
ERROR 1: TIFFAppendToStrip:TQ00tiled.TIF: Write error at scanline 3840
ERROR 1: TIFFAppendToStrip:TQ00tiled.TIF: Write error at scanline 3840
ERROR 1: TIFFAppendToStrip:TQ00tiled.TIF: Write error at scanline 0
ERROR 1: TIFFAppendToStrip:TQ00tiled.TIF: Write error at scanline 0
ERROR 1: TIFFAppendToStrip:TQ00tiled.TIF: Write error at scanline 256
ERROR 1: TIFFAppendToStrip:TQ00tiled.TIF: Write error at scanline 256
ERROR 1: TIFFAppendToStrip:TQ00tiled.TIF: Write error at scanline 512
ERROR 1: TIFFAppendToStrip:TQ00tiled.TIF: Write error at scanline 512
ERROR 1: TIFFAppendToStrip:TQ00tiled.TIF: Write error at scanline 768
etc...

I've got this to work on one or two of the files, but the resultant TIF is
now averaging 90Mb, rather than 7Mb, and thats without adding overviews on
top of that.

An example tile and worldfile can be found here
http://sites.google.com/a/vanbooth.com/transfer/Home

I'm currently using GDAL 1.2.0.0 (released 2004/03/01) on AIX.

Has anybody got any idea of how I can convert these rasters to something
useable and performant?

MTIA

Rob
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20080421/582cb02a/attachment-0001.html


More information about the gdal-dev mailing list