Return-Path: <tiff-bounces@lists.maptools.org>
Received: from inas025.isp.belgacom.be (localhost [127.0.0.1])
        by inav005.isp.belgacom.be (8.12.11.20060308/8.12.11/Skynet-IN-AV-3.00) with ESMTP id l15Im1kh015924
        for <joris.at.lebbeke@skynet.be>; Mon, 5 Feb 2007 19:48:02 +0100
        (envelope-from <tiff-bounces@lists.maptools.org>)
Received: from inmx016.isp.belgacom.be (inmx016.isp.belgacom.be [195.238.4.219])
        by inas025.isp.belgacom.be (8.12.11.20060308/8.12.11/Skynet-IN-AS-2.03) with ESMTP id l15IlvL6006981
        for <joris.at.lebbeke@skynet.be>; Mon, 5 Feb 2007 19:47:58 +0100
        (envelope-from <tiff-bounces@lists.maptools.org>)
Received: from duke.maptools.org (r153.dmsolutions.ca [209.217.116.153] (may be forged))
        by inmx016.isp.belgacom.be (8.12.11.20060308/8.12.11/Skynet-IN-2.32) with ESMTP id l15IlnfN030060
        for <joris.at.lebbeke@skynet.be>; Mon, 5 Feb 2007 19:47:49 +0100
        (envelope-from <tiff-bounces@lists.maptools.org>)
Received: from duke.maptools.org (duke.maptools.org [127.0.0.1])
	by duke.maptools.org (8.12.11/8.12.10) with ESMTP id l15IRkIL028468;
	Mon, 5 Feb 2007 13:27:54 -0500
Received: from admin1.aeromap.com (209-193-48-179-cdsl-rb1.anc.acsalaska.net
	[209.193.48.179])
	by duke.maptools.org (8.12.11/8.12.10) with ESMTP id l15IRiOs028464;
	Mon, 5 Feb 2007 13:27:44 -0500
Content-Class: urn:content-classes:message
MIME-Version: 1.0
Content-Type: text/plain;
	charset="iso-8859-1"
X-MimeOLE: Produced By Microsoft Exchange V6.0.6603.0
Subject: RE: [Geotiff] RE: [Tiff] Re: get tifftag_geoasciiparams string
Date: Mon, 5 Feb 2007 09:27:30 -0900
Message-ID: <3054411AF4728548AD6D7137190D56B30C45C4@admin1.aeromap.com>
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
Thread-Topic: [Geotiff] RE: [Tiff] Re: get tifftag_geoasciiparams string
Thread-Index: AcdH5FiL1ezhQmXESmCRZl510kQYLwBbWoDQ
From: "Gennady Khokhorin" <gok@aerometric-ak.com>
To: "Niles Ritter" <ritter@earthlink.net>
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from quoted-printable to 8bit by duke.maptools.org id
	l15IRiOs028464
Cc: geotiff@lists.maptools.org, tiff@lists.maptools.org,
        Phil Harvey <phil@owl.phy.queensu.ca>
X-BeenThere: tiff@lists.maptools.org
X-Mailman-Version: 2.1.4
Precedence: list
List-Id: TIFF and libtiff discussion <tiff.lists.maptools.org>
List-Unsubscribe: <http://lists.maptools.org/mailman/listinfo/tiff>,
	<mailto:tiff-request@lists.maptools.org?subject=unsubscribe>
List-Archive: <http://lists.maptools.org/mailman/private/tiff>
List-Post: <mailto:tiff@lists.maptools.org>
List-Help: <mailto:tiff-request@lists.maptools.org?subject=help>
List-Subscribe: <http://lists.maptools.org/mailman/listinfo/tiff>,
	<mailto:tiff-request@lists.maptools.org?subject=subscribe>
Sender: tiff-bounces@lists.maptools.org
Errors-To: tiff-bounces@lists.maptools.org
X-UIDL: 000000000023ceae.0000209c
X-MSP-STORE: Mon, 05 Feb 2007 19:48:09 +0100
Status:   

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
> Sent: Thursday, February 01, 2007 3:08 PM
> To: tiff@lists.maptools.org
> Subject: [Tiff] Re: get tifftag_geoasciiparams string
> 
> 
> 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
> 
> - Phil
> 
> _______________________________________________
> Tiff mailing list: Tiff@lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/tiff
> http://www.remotesensing.org/libtiff/
> 
> _______________________________________________
> Geotiff mailing list
> Geotiff@lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/geotiff


_______________________________________________
Tiff mailing list: Tiff@lists.maptools.org
http://lists.maptools.org/mailman/listinfo/tiff
http://www.remotesensing.org/libtiff/
