[Gdal-dev] Gdalwarp - corrupt merge

Craig Miller craig.miller at spatialminds.com
Mon May 7 23:19:25 EDT 2007


Frank,

Thanks for the help.  I'll try a newer version of libtiff and the latest
version of gdal and see how it goes.  It's been a while since I've updated
my source tree anyway.

Craig
 

-----Original Message-----
From: Frank Warmerdam [mailto:warmerdam at pobox.com] 
Sent: Monday, May 07, 2007 8:33 PM
To: Craig Miller
Cc: 'Gdal-Dev'
Subject: Re: [Gdal-dev] Gdalwarp - corrupt merge

Craig Miller wrote:
> When using gdalwarp on paletted geotiffs that have "TILED=YES" and 
> "COMPRESS=LZW" set during creation I'm running into a couple of 
> problems.  I confirmed via gdalinfo that all input files have the 
> projection defined as EPSG:4326.
> 
> Problem #1
> Gdalwarp existing_file1.tif existing_file2.tif corrupts the second image.
> Projection is stripped, and none of my apps (non-gdal) can read the 
> image (E.g. global mapper).  gdalinfo shows the projection being 
> stripped, still paletted image.  Any suggestions on how to merge two 
> geotiffs in this format?

Craig,

I don't see this result.  I suspect it relates to the specific version of
libtiff being used.  Some important fixes have gone into libtiff in support
of GDAL using it for random update to compressed files (ie.
gdalwarp using LZW compression).

You might want to try this with gdal's trunk (development) version, and
configured to use the internal libtiff (--with-tiff=internal).  If the
problem persists and we will see if we can reproduce it.

> Problem #2
> gdalwarp -te xmin ymin xmax ymax infile.tif outfile.tif Outputfile has 
> no projection defined, compression is lost, and I assume tiling is 
> too.
> Everything works ok if I specify -co options, -s_srs, -t_srs, etc but 
> I thought it was supposed to output everything the same as the input.

I also do not see this result.  I just tried:

gdalwarp -te 440000 3720000 470000 3750000 utm.tif out.tif

and out.tif has the same coordinate system as the input file.  The
compression and tiling are not copied over.  These are considered to be file
specific options, and not part of the overall GDAL data model, so they do
not carry over to a copied file.

If you can file a bug demonstrating the coordinate system we can certainly
try and fix it, but this doesn't normally happen so it must be something
very specific to your situation.

Best regards,
-- 
---------------------------------------+--------------------------------
---------------------------------------+------
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    | President OSGeo, http://osgeo.org




More information about the Gdal-dev mailing list