[Geotiff] Libtiff 4.0.0 Released

Fred Rothganger fred at rothganger.org
Tue Jan 31 22:16:48 EST 2012


On 01/31/2012 10:42 AM, Frank Warmerdam wrote:
> Fred, There is an enumerated list of geokeys with their numeric value 
> and textual name in the _keyInfo[] array declared in geonames.h. I 
> think you could use it as a list. But this does not include the types, 
> and in fact there is no enforcement of particular keys having 
> particular types in the library. It is entirely dependent on 
> applications doing the right thing. I imagine geonames.h is not 
> public. If necessary I'd consider providing a public function that 
> exposes these declarations in some fashion so it would be easy 
> (easier) to turn numeric values into names, and to see the list of 
> valid numeric values. 

Frank,

Looked at my code a little more closely.  It's been a few years since I 
wrote it, so I didn't understand it correctly.  :)  Anyway, I'm actually 
using GTIFKeyCode() to translate a string into an integer ID.  After 
that, I'm using my own lookup table to find the type of the key 
(TYPE_SHORT, TYPE_DOUBLE, TYPE_ASCII).  What would be nice is a function 
that would tell me the type of a key.  Apparently I tried to use 
GTIFKeyInfo() to do this, but it will only return info for keys actually 
present in the file.  Could we have a function like

tagtype_t GTIFKeyType (geokey_t)

that takes an arbitrary key and returns its type?

> I'm willing to collaborate on accessors and perhaps we could use 
> successful migration of tiffset to public interfaces as a test case 
> for our success. Would you be willing to propose accessors and provide 
> a patch or would you prefer I take the lead? 

Following the principle of laziness, I would rather you take the lead.  
:)  However, I'm willing to help if necessary.  As for accessors, here 
are the fields I actually use:

field_type
field_tag
field_readcount
field_writecount
field_passcount

In addition, tiffset.c uses

field_name

-- Fred




More information about the Geotiff mailing list