User-defined keys

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

User-defined keys

tjn98
Dear All,

  How do you write user-defined keys? The GeoTIFF specification allows
user-defined keys with codes of 32768 and above (section 2.7.2), but the
libgeotiff library function GTIFKeySet() only accepts legal geokey_t
enumerations.

  My tentative conclusion is that I must extend the list "geokeys.inc"
before compiling. Is this right, and is there anything else I must do?

    Regards,

  Tim Nightingale.

------------------------------------------------------------------------
 Tim Nightingale
  RAL Space
    STFC Rutherford Appleton Laboratory
     Harwell Oxford
      Didcot                          Phone: +44/0 1235 445914
        OX11 0QX                      Fax:   +44/0 1235 445848
         United Kingdom               Email: [hidden email]
------------------------------------------------------------------------
--
Scanned by iCritical.
_______________________________________________
Geotiff mailing list
[hidden email]
http://lists.maptools.org/mailman/listinfo/geotiff
Reply | Threaded
Open this post in threaded view
|

Re: User-defined keys

Frank Warmerdam
On Mon, Oct 24, 2011 at 9:38 AM,  <[hidden email]> wrote:
> Dear All,
>
>  How do you write user-defined keys? The GeoTIFF specification allows
> user-defined keys with codes of 32768 and above (section 2.7.2), but the
> libgeotiff library function GTIFKeySet() only accepts legal geokey_t
> enumerations.
>
>  My tentative conclusion is that I must extend the list "geokeys.inc"
> before compiling. Is this right, and is there anything else I must do?

Tim,

Skimming through the geo_set.c code I don't see any sign that it is
necessary to have a geokey defined in geokeys.inc before you can
set them in a file.  As far as I know you can just call GTIFKeySet()
with your own codes and things should work though I haven't tested
this.

If you want listgeo to report your user defined geokeys with a
symbolic name then you would need to add them to geokeys.inc.
I think it exists primarily to associate symbolic names with the
geokey values.

I see that you don't need to define their type or anything.  This
is all defined by the call to GTIFKeySet().

Best regards,


--
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, [hidden email]
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Software Developer
_______________________________________________
Geotiff mailing list
[hidden email]
http://lists.maptools.org/mailman/listinfo/geotiff
Reply | Threaded
Open this post in threaded view
|

Re: User-defined keys

tjn98
Frank,

  Thanks for getting back to me. The reason I asked was that the
definition of the key ID, geokey_t in geokeys.h is built from the
geokeys.inc list. I thought I might need a correctly enumerated
key value to get past the GTIFKeySet() header definition, though
once in, all ought to be fine, as you say.

  Since I'm not that familiar with the library, I also wanted to
make sure that I wouldn't break anything else!

  I guess we should try and see what happens.

    Regards,

      Tim.




On 24/10/2011 17:59, "Frank Warmerdam" <[hidden email]> wrote:

>On Mon, Oct 24, 2011 at 9:38 AM,  <[hidden email]> wrote:
>> Dear All,
>>
>>  How do you write user-defined keys? The GeoTIFF specification allows
>> user-defined keys with codes of 32768 and above (section 2.7.2), but the
>> libgeotiff library function GTIFKeySet() only accepts legal geokey_t
>> enumerations.
>>
>>  My tentative conclusion is that I must extend the list "geokeys.inc"
>> before compiling. Is this right, and is there anything else I must do?
>
>Tim,
>
>Skimming through the geo_set.c code I don't see any sign that it is
>necessary to have a geokey defined in geokeys.inc before you can
>set them in a file.  As far as I know you can just call GTIFKeySet()
>with your own codes and things should work though I haven't tested
>this.
>
>If you want listgeo to report your user defined geokeys with a
>symbolic name then you would need to add them to geokeys.inc.
>I think it exists primarily to associate symbolic names with the
>geokey values.
>
>I see that you don't need to define their type or anything.  This
>is all defined by the call to GTIFKeySet().
>
>Best regards,
>
>
>--
>---------------------------------------+----------------------------------
>----
>I set the clouds in motion - turn up   | Frank Warmerdam,
>[hidden email]
>light and sound - activate the windows | http://pobox.com/~warmerdam
>and watch the world go round - Rush    | Geospatial Software Developer

--
Scanned by iCritical.
_______________________________________________
Geotiff mailing list
[hidden email]
http://lists.maptools.org/mailman/listinfo/geotiff