[ 
https://issues.apache.org/jira/browse/IMAGING-313?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17429778#comment-17429778
 ] 

Gary Lucas edited comment on IMAGING-313 at 10/17/21, 11:35 PM:
----------------------------------------------------------------

The existing Apache Commons Imaging distribution includes an example 
application that opens a TIFF image file and extracts the metadata ("tags" in 
the TIFF parlance) for inspection.  I propose to extend the utility to include 
a summary of GeoTIFF-specific tags.

GeoTIFFs are an important class of TIFF files that are used to show imagery 
that has a geographic basis. They include Satellite images, aerial photographs, 
digitized maps, and even some numerical data such as elevations. The GeoTIFF 
standard is a well-known, though slightly complex specification.

The current example application, ReadTagsAndImages.java, prints all tags in the 
TIFF file, but the GeoTIFF related information is presented as abstract 
numerical values. I propose to add logic to the tag-reading application to 
format some of that GeoTIFF information as human-friendly strings. 

Here's an example of a numeric data file giving high-resolution elevation data 
(some tags omitted).  The GeoKeyDirectoryTag is essentially a dictionary giving 
a guide to the content to follow.  In this case, it consists of 36 integer 
value.   In the Summary of GeoTIFF Elements, the proposed application 
interprets those integer constants as named strings.
{code:java}
Directory  0 Numeric raster data, description: Root
 256 (0x100: ImageWidth): 10812 (1 Short)
 257 (0x101: ImageLength): 10812 (1 Short)
 [snip]
 34735 (0x87af: GeoKeyDirectoryTag): 1, 1, 0, 8, 1024, 0, 1, 2, 1025, 0, 1, 1, 
(36 elements)
 34737 (0x87b1: GeoAsciiParamsTag): 'NAD83|' (7 ASCII)
 42112 (0xa480: GDALMetadata): '<GDALMetadata>
  <Item name="BandDefinitionKeyword">NONE</I
 42113 (0xa481: GDALNoData): '-999999' (8 ASCII)

Summary of GeoTIFF Elements -----------------
Content Type: Numeric, Floating Point (32-bit samples)    GDAL No-Data value: 
-999999

GeoKey Table
     key     ref     len   value/pos     name
       1       1       0       8         ~~~                     ~~~
    1024       0       1       2         GTModelTypeGeoKey       Geographic 
Coordinate System
    1025       0       1       1         GTRasterTypeGeoKey      
RasterPixelIsArea
    2048       0       1    4269         GeographicTypeGeoKey    North Amer. 
Datum 1983
    2049   34737       6       0   (A)   GeogCitationGeoKey      NAD83
    2054       0       1    9102         GeogAngularUnitsGeoKey  Degrees
    2057   34736       1       1   (D)   GeogSemiMajorAxisGeoKey 6378137.0
    2059   34736       1       0   (D)   GeogInvFlatteningGeoKey 298.25722210
    2062   34736       3       2   (D)   To_WGS84_GeoKey         0.0 | 0.0 | 0.0

ModelPixelScale
   9.2592592526e-05   9.2592592526e-05   0.0000000000e+00

ModelTiepointTag
           Pixel                           Model
      0.0   0.0   0.0           -89.001       38.001        0.000
{code}
Finally, I note that the existing ReadTagsAndImages.java application is 
intended to be *example code* that shows how to use the Apache Commons Imaging 
API.  In that spirit, I will try to isolate the new GeoTIFF logic from the more 
generic TIFF logic.  My goal will be to preserve the clarity of the example.

 


was (Author: gwlucas):
The existing Apache Commons Imaging distribution includes an example 
application that opens a TIFF image file and extracts the metadata ("tags" in 
the TIFF parlance) for inspection.  I propose to extend the utility to include 
a summary of GeoTIFF-specific tags.

GeoTIFFs are an important class of TIFF files that are used to show imagery 
that has a geographic basis. They include Satellite images, aerial photographs, 
digitized maps, and even some numerical data such as elevations. The GeoTIFF 
standard is well-known, though slightly complex specification.

The current example application, ReadTagsAndImages.java, prints all tags in the 
TIFF file, but the GeoTIFF related information is presented as abstract 
numerical values. I propose to add logic to the tag-reading application to 
format some of that GeoTIFF information as human-friendly strings. 

Here's an example of a numeric data file giving high-resolution elevation data 
(some tags omitted).  The GeoKeyDirectoryTag is essentially a dictionary giving 
a guide to the content to follow.  In this case, it consists of 36 integer 
value.   In the Summary of GeoTIFF Elements, the proposed application 
interprets those integer constants as named strings.
{code:java}
Directory  0 Numeric raster data, description: Root
 256 (0x100: ImageWidth): 10812 (1 Short)
 257 (0x101: ImageLength): 10812 (1 Short)
 [snip]
 34735 (0x87af: GeoKeyDirectoryTag): 1, 1, 0, 8, 1024, 0, 1, 2, 1025, 0, 1, 1, 
(36 elements)
 34737 (0x87b1: GeoAsciiParamsTag): 'NAD83|' (7 ASCII)
 42112 (0xa480: GDALMetadata): '<GDALMetadata>
  <Item name="BandDefinitionKeyword">NONE</I
 42113 (0xa481: GDALNoData): '-999999' (8 ASCII)

Summary of GeoTIFF Elements -----------------
Content Type: Numeric, Floating Point (32-bit samples)    GDAL No-Data value: 
-999999

GeoKey Table
     key     ref     len   value/pos     name
       1       1       0       8         ~~~                     ~~~
    1024       0       1       2         GTModelTypeGeoKey       Geographic 
Coordinate System
    1025       0       1       1         GTRasterTypeGeoKey      
RasterPixelIsArea
    2048       0       1    4269         GeographicTypeGeoKey    North Amer. 
Datum 1983
    2049   34737       6       0   (A)   GeogCitationGeoKey      NAD83
    2054       0       1    9102         GeogAngularUnitsGeoKey  Degrees
    2057   34736       1       1   (D)   GeogSemiMajorAxisGeoKey 6378137.0
    2059   34736       1       0   (D)   GeogInvFlatteningGeoKey 298.25722210
    2062   34736       3       2   (D)   To_WGS84_GeoKey         0.0 | 0.0 | 0.0

ModelPixelScale
   9.2592592526e-05   9.2592592526e-05   0.0000000000e+00

ModelTiepointTag
           Pixel                           Model
      0.0   0.0   0.0           -89.001       38.001        0.000
{code}
Finally, I note that the existing ReadTagsAndImages.java application is 
intended to be *example code* that shows how to use the Apache Commons Imaging 
API.  In that spirit, I will try to isolate the new GeoTIFF logic from the more 
generic TIFF logic.  My goal will be to preserve the clarity of the example.

 

> Provide summary of GeoTIFF tags in example TIFF-dump application
> ----------------------------------------------------------------
>
>                 Key: IMAGING-313
>                 URL: https://issues.apache.org/jira/browse/IMAGING-313
>             Project: Commons Imaging
>          Issue Type: New Feature
>          Components: Format: TIFF
>    Affects Versions: 1.0-alpha3
>            Reporter: Gary Lucas
>            Priority: Minor
>




--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to