[Geotiff] Copy projection between GeoTIFFs
Frank Warmerdam
warmerdam at pobox.com
Wed Nov 12 12:24:01 EST 2008
jeskynar wrote:
> warmerdam at pobox.com wrote:
>> The listgeo and geotifcp cannot be used to reset the geotiff information
>> "in place" as things stand though this can be accomplished using the API
>> with some care. GDAL does this for instance.
>
> Do you mean there is a GDAL utility or something in the API?
>
>> It would be relatively easy to modify geotifcp to have a "reset geo tags
>> from metadata file, but do nothing else" option or perhaps write a small
>> new utility called "applygeo". However, I'm not likely to do so.
>
> Below is my attempt an applygeo.c, but I haven't used the libgeotiff API
> "with some care" because it doesn't appear to do anything! And if I add
> a call to TIFFRewriteDirectory before XTIFFClose it crashes (assertion
> tif_flags&0x80000 failed). Any ideas?
Jeskynar,
I added the TIFFRewriteDirectory() and it worked fine for me, but I'm using
libtiff4 (latest from cvs). What version of libtiff are you using?
I also found I had to make an effort to clear the existing tags if I wanted
to be able to replace existing geotiff tags properly (clearing existing tags
that aren't in the new .geo file). I have attached my modified version.
If you give me permission to distribute your code under the normal libtiff
license, I'll add applygeo in subversion.
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: applygeo.c
Type: text/x-csrc
Size: 2512 bytes
Desc: not available
Url : http://lists.maptools.org/pipermail/geotiff/attachments/20081112/ae260fc2/applygeo.bin
More information about the Geotiff
mailing list