[gdal-dev] Copy / manipulate TIFF-header

Sigbjorn Herstad sherstad at gmail.com
Fri Mar 5 04:51:45 EST 2010

Using the Python-script I was able to update the SetGeoTransform and
SetProjection with success. I have also done the same with a VB-script
with the same result. I do not see anything wrong in the header and
the file itself opens without errors.
Thanks for the warning regarding bugs in the libtiff and libgeotiff.

1. I am curious - how can I figure out if a file is broken after
updating the Transform, Projection and other parameters? Is simply
loading the file into some software and displaying it properly and
checking that the header have OK values sufficient? Or is there a more
"programmatic" way to figure out?

The option to update-in-place on files is nice when you have 200-500
GB of uncompressed TIF-files, as reprocessing them takes a while.

2. As I understand it the Updating-in-place is the problem. If I want
to create a new file with certain specified tags there should be "no"
problem writing this and risking corrupt files?

On Fri, Mar 5, 2010 at 2:16 AM, Frank Warmerdam <warmerdam at pobox.com> wrote:
> Sigbjorn Herstad wrote:
> I do not believe it is possible to accomplish this with commandline
> tools like listgeo and geotifcp, or with scripting around GDAL.
> It is, in theory, possible to accomplish this using a C program
> built on libtiff and libgeotiff.  But if you do this you need to be
> careful to use the very latest libgeotiff code (possibly from svn) and
> also very recent libtiff code (best from svn).  Rewriting a TIFF
> directory is a risky process and some bugs have recently been fixed
> in this regard.  Likewise, updating a GTIF (GeoTIFF tags) structure
> in place is risky and recently some changes were made in libgeotiff
> to support this.
> Generally speaking libtiff and libgeotiff were not written with update
> in place in mind which is why it is surprisingly hard.  Just how
> important is it to you?
> 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    | Geospatial Programmer for Rent

More information about the gdal-dev mailing list