2006.06.05 21:02 "[Tiff] geokeydirectory tag", by oded orbach

2006.06.06 13:53 "Re: [Tiff] geokeydirectory tag", by Frank Warmerdam

I've encountered a problem concerning this tag, which seems strange to me:

my application clones a tiff file by reading data + tags from a file and writing them to a new file. all going well, except for one specific file, with this specific tag.

at the original file, this tag contained the values:

1, 1, 0, 2, 1024, 0, 1, 32767, 2048, 0, 1, 0
but at the new file, this tag contains:
1, 1, 0, 1, 1024, 0, 1, 32767

which means it for some reason 'cut' the last keyEntry, and changed the 4th element accordingly (or vice versa?)

for reading and writing tags I use TIFFGetField and TIFFSetField or GTIFFKeyGet and GTIFFKeySet.

what so strange about it is the fact that it worked well for another tiff file, in which this tag contained the values:

1, 1, 0, 2, 1024, 0, 1, 0, 2048, 0, 1, 0
and the same for the output file.

so if I thought that there is a problem with the tag whose ID is 2048 (GeographicTypeGeoKey), this shows that I'm wrong, and if I thought that the reason for the 'cutting' was that the value of this tag is 0 (since the value after 2048 is 0 then the 4th value of this keyEntry set should be the actual value of the key) which means it's undefined, this also shows I'm wrong.


I'm not sure why it isn't working for you. But I did want to stress that you can treat the GeoTIFF tags directly using TIFFGetField() and TIFFSetField() *or* you can manipulate them with GTIFFKeyGet() and GTIFFKeySet(). You should avoid trying to do both as this might result in any number of mixups.

If you want more help I suspect you will need to provide a minimal simple program that demonstrates your problem, along with an input file.

Best regards,

I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam@pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam

and watch the world go round - Rush    | President OSGF, http://osgeo.org