2007.02.01 23:14 "[Tiff] Re: get tifftag_geoasciiparams string", by Phil Harvey

2007.02.05 18:27 "RE: [Geotiff] RE: [Tiff] Re: get tifftag_geoasciiparams string", by Gennady Khokhorin

Thanks, Niles, for you respond.

Now it is clear that TIFFGetField() still returns a number of null terminated strings, not a flag (true/false). Wish to see your explanation somewhere in libgeotiff manual or at least in GeoTIFF FAQ.

Low level commands are used to handle georeference in LIDAR data (LAS 1.1) exchanging geoTIFF info in binary form. Dont need to parse tags, just throwing from geoTIFF and back as is.

Happy programming!

gok

-----Original Message-----
From: Niles Ritter [mailto:ritter@earthlink.net]
Sent: Saturday, February 03, 2007 1:39 PM
To: Gennady Khokhorin

Cc: Phil Harvey; tiff@lists.maptools.org; geotiff@lists.maptools.org Subject: Re: [Geotiff] RE: [Tiff] Re: get tifftag_geoasciiparams string

In the TIFF spec it indicates that an ASCII tag can, theoretically, contain multiple values, each separated by a NULL terminator. This has proven to be a problem in practice, and so no one really uses multi-valued ASCII tags as described in the TIFF spec.

The TIFFGetField should return the number of null-terminated strings, and not the length. For most TIFF tags on the planet, you should therefore get either 1 or 0.

To avoid null-termination miseries, the GeoTIFF spec stores its strings in a single ASCII tag, with '|' pipe-delimiters (tacitly assuming that the data itself contains no pipes). So, calling TIFFGetField directly on a GeoTIFF image should give you back a value of 1, and store the string in &data. It is up to you to parse out the separate pipe-delimited values.

Not sure why you want to use the lower-level libtiff to roll-your-own GeoTIFF, but best of luck, in any case. The first thing you will find is that you will, at least, need to use the "xtiff" tiff-extender code in the libgeotiff source so that the libtiff image-tag parsing code will recognize the "unknown" GeoTIFF tags.

--Niles.

On Fri, 2007-02-02 at 10:36 -0900, Gennady Khokhorin wrote:

Thanks, Phil, for respond.

I agree: docs are pure. I have the same manual.txt for libgeotiff.

Still can not find any reference for return from TIFFGetField(tif, TIFFTAG_GEOASCIIPARAMS, &data) command. The other two return number of elements as a parameter: TIFFGetField(tif, TIFFTAG_GEOKEYDIRECTORY, &size, &data);

TIFFGetField(tif, TIFFTAG_GEODOUBLEPARAMS, &size, &data);

TIFFGetField() description in tiff-3.8.2\html\man\TIFFGetField.3tiff.html shows in "Autoregistered tags" sample that ascii tag should be handled the same way. But real code is different.

I want to use TIFF approach to handle tags (shorts, doubles, ascii) as an arrays rather then GTIFFKeySet/GTIFFKeyGet for each tag. Thanks to gdal it handles geoTiff great.

Any help, please!

Gennady

-----Original Message-----

From: tiff-bounces@lists.maptools.org [mailto:tiff-bounces@lists.maptools.org]On Behalf Of Phil Harvey

Sorry, I meant to give you this reference so you can download the GeoTiff library, which I believe includes documentation:

  ftp://ftp.remotesensing.org/geotiff/libgeotiff/libgeotiff-1.2.3.tar.gz

> Geotiff mailing list
> Geotiff@lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/geotiff