Skip to main content

[JAI] GeoTIFF typedefs (constants) question

1 reply [Last post]
Anonymous

I have another question on this topic. Is it really necessary that all the
unsigned short constants for GeoKeys and their various codes have constant
type definitions such as here?

http://download.java.net/media/jai-imageio/geotiff/com/sun/media/imageio...

Or would mappings such as those provided by getGeoKey() in

http://download.java.net/media/jai-imageio/geotiff/com/sun/media/imageio...

and getCodeName() and getCodeNumber() in

http://download.java.net/media/jai-imageio/geotiff/com/sun/media/imageio...

be sufficient? While providing the constants would more closely parallel what
was done with TIFFTagSet

http://java.sun.com/products/java-media/jai/forDevelopers/jai-imageio-1_...

and its subclasses, having all those typedefs seems a little like overkill.
Also, it would probably be better to define these things using enums but that
would require Java 5.

If the constant definitions are really required in the interface classes, then
it would seem better to put them in a separate class such as GeoKeyDefs

http://download.java.net/media/jai-imageio/geotiff/com/sun/media/imageio...

as that would permit a cleaner path eventually to changing them to enums.

Thanks,

Brian

----------------
Brian Burkhalter
Java Multimedia, Imaging, and Graphics
Sun Microsystems, Inc.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This email message is for the sole use of the intended recipient(s)
and may contain confidential and privileged information. Any
unauthorized review, use, disclosure or distribution is prohibited.
If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@jai.dev.java.net
For additional commands, e-mail: interest-help@jai.dev.java.net

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Bryce L Nordgren

Brian.Burkhalter@Sun.COM wrote on 10/19/2005 12:29:14 PM:

> I have another question on this topic. Is it really necessary that all
the
> unsigned short constants for GeoKeys and their various codes have
constant
> type definitions such as here?

"Necessary" is a flexible word. It depends on the level of service you
want to provide. A key/code map is sufficient up until the point when code
needs to query for a specific key. At that point it needs to hard code the
key it needs. This is best done with typedefs as the compiler can catch
spelling errors. On the other hand, a generic key dumper doesn't ever need
to treat individual keys "specially".

Even in the "typedef" realm, there's levels of service. You can typedef
the GeoKeys only. Or GeoKeys and a "reasonable" subset of values. Or the
whole shooting match.

You will probably draw the least fire by providing comprehensive typedef
support.

There's two easy ways out for comprehensive typedefs:

1] Get Mike Nidel to sign your paperwork and contribute the typedefs he's
already committed in his GeotiffIIOMetadataAdapter. The license at the top
of the file I have is very liberal. Who knows? He may even have uploaded
the code to this list once or twice.

2] I can typedef things for you and upload them. These will come to you in
the public domain complements of the US Government, as required by
17USC105.

Talk to Mike first. My desire to reinvent the wheel is very slim. :)

Bryce
PS: Please don't require Java5.

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@jai.dev.java.net
For additional commands, e-mail: interest-help@jai.dev.java.net