[gdal-dev] GeoTIFF with LZW compression Overviews error

Frank Warmerdam warmerdam at pobox.com
Wed Feb 13 10:32:50 PST 2013


Fabian,

I'm assuming you mean gdaladdo is run on y.tif, the output of gdalwarp, right?

I tried the steps with a manufactured input file of the same size and
did not encounter the problem on my system.  The most likely important
difference is that I am not using libtiff 3.9.4 - I'm using libtiff
4.0.x (trunk).  Is there a reason you are using the old style libtiff?
 Perhaps just because it is what is packaged?  I imagine that is the
problem.

Best regards,
Frank



On Wed, Feb 13, 2013 at 9:01 AM, Fabian Schindler
<fabian.schindler at eox.at> wrote:
> Dear devs,
>
> I'm experiencing strange errors when I try to add overviews to specific
> GeoTIFF files with internal tiling and LZW compression. This error shows
> only on some (about 3-5%) of the input files.
>
> This is how I process the file:
>
> $gdal_translate -gcp 0 0 19.09 49.22 -gcp 100 0 20.1 49.11 -gcp 100 401
> 19.27 45.89 -gcp 100 802 18.42 42.34 -gcp 100 1203 17.6 38.79 -gcp 100 1605
> 17.41 37.96 -gcp 0 1605 16.58 38.07 -gcp 0 1203 16.76 38.91 -gcp 0 802 17.53
> 42.45 -gcp 0 401 18.33 46.0 -of GTIFF -a_srs EPSG:4326 -co compress=LZW -co
> tiled=YES x.jpg x.tif
>
> $gdalwarp -t_srs EPSG:4326 -co tiled=YES -co compress=LZW x.tif y.tif
>
> $gdaladdo c.tif 2 4 8 16 32
>
> 0...10...20...30...40...50...60...70...80...90...Warning 1: c.tif:LZWDecode:
> Strip -1 not terminated with EOI code
>
> ERROR 1: c.tif:LZWDecode: Not enough data at scanline 0 (short 46008 bytes)
>
> ERROR 1: TIFFReadEncodedTile() failed.
>
> ERROR 1: IReadBlock failed at X offset 0, Y offset 2
>
> ERROR 1: GetBlockRef failed at X block offset 0, Y block offset 2
>
> 100 - done.
>
> Any ideas/help on that?
>
> Thanks in advance,
> Fabian
>
>
> FYI: I'm on a CentOS box with GDAL 1.9.1, released 2012/05/15, and
> libgeotiff 1.4.0-1.el6, and libtiff 3.9.4-6.el6_3.
>
> A gdalinfo of the file shows:
>
> Driver: GTiff/GeoTIFF
>
> Files: x.tif
>
> Size is 1497, 4965
>
> Coordinate System is:
>
> GEOGCS["WGS 84",
>
>     DATUM["WGS_1984",
>
>         SPHEROID["WGS 84",6378137,298.257223563,
>
>             AUTHORITY["EPSG","7030"]],
>
>         AUTHORITY["EPSG","6326"]],
>
>     PRIMEM["Greenwich",0],
>
>     UNIT["degree",0.0174532925199433],
>
>     AUTHORITY["EPSG","4326"]]
>
> Origin = (9.291424276853256,49.550154279390341)
>
> Pixel Size = (0.007350754725447,-0.007350754725447)
>
> Metadata:
>
>   AREA_OR_POINT=Area
>
> Image Structure Metadata:
>
>   COMPRESSION=LZW
>
>   INTERLEAVE=PIXEL
>
> Corner Coordinates:
>
> Upper Left  (   9.2914243,  49.5501543) (  9d17'29.13"E, 49d33' 0.56"N)
>
> Lower Left  (   9.2914243,  13.0536571) (  9d17'29.13"E, 13d 3'13.17"N)
>
> Upper Right (  20.2955041,  49.5501543) ( 20d17'43.81"E, 49d33' 0.56"N)
>
> Lower Right (  20.2955041,  13.0536571) ( 20d17'43.81"E, 13d 3'13.17"N)
>
> Center      (  14.7934642,  31.3019057) ( 14d47'36.47"E, 31d18' 6.86"N)
>
> Band 1 Block=256x256 Type=Byte, ColorInterp=Red
>
>   Overviews: 749x2483, 375x1242, 188x621, 94x311, 47x156
>
> Band 2 Block=256x256 Type=Byte, ColorInterp=Green
>
>   Overviews: 749x2483, 375x1242, 188x621, 94x311, 47x156
>
> Band 3 Block=256x256 Type=Byte, ColorInterp=Blue
>
>   Overviews: 749x2483, 375x1242, 188x621, 94x311, 47x156
>
>
>
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev



-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Software Developer


More information about the gdal-dev mailing list