Opened 15 years ago

Closed 15 years ago

#3019 closed enhancement (fixed)

Support GeoTIFF with only ProjectedCSTypeGeoKey defined

Reported by: Even Rouault Owned by: Even Rouault
Priority: normal Milestone: 1.7.0
Component: GDAL_Raster Version: unspecified
Severity: normal Keywords:
Cc:

Description

In a (not publically available) GeoTIFF conformance test, you can find images with only ProjectedCSTypeGeoKey defined, and GTModelTypeGeoKey missing. According to the cookbook of the GeoTIFF Specification, the natural processing order should be : 1) check that GTModelTypeGeoKey=ModelTypeProjected 2) look at the value of ProjectedCSTypeGeoKey But this does not really seem to be enforced as a hard requirement.

Currently GDAL implements that and in the case of the offending test data, it returns LOCAL_CS["unnamed",UNIT["metre",1,AUTHORITY["EPSG","9001"]]].

FrankW has agreed that before returning LOCAL_CS, checking if ProjectedCSTypeGeoKey is defined and then assuming GTModelTypeGeoKey=ModelTypeProjected would make sense. This shouldn't cause regressions for other cases. Note that this could similarly be extended for the GCS case, but I won't go onto that slippery way until they invent the corresponding offending data ;-)

Change History (1)

comment:1 by Even Rouault, 15 years ago

Resolution: fixed
Status: newclosed

Commited in trunk (r17182) and test added (r17183). The test image was produced by hacking gt_wkt_srs.cpp especially for that purpose, but the end result is representative of the original image from the conformance test that triggered that ticket.

listgeo extract :

 Geotiff_Information:
   Version: 1
   Key_Revision: 1.0
   Tagged_Information:
      ModelTiepointTag (2,3):
         0                0                0                
         440720           3751320          0                
      ModelPixelScaleTag (1,3):
         60               60               0                
      End_Of_Tags.
   Keyed_Information:
      ProjectedCSTypeGeoKey (Short,1): PCS_WGS84_UTM_zone_31N
      End_Of_Keys.
   End_Of_Geotiff.

gdalinfo extract after patch: Coordinate System is:

PROJCS["WGS 84 / UTM zone 31N",
    GEOGCS["WGS 84",
        DATUM["WGS_1984",
            SPHEROID["WGS 84",6378137,298.257223563,
                AUTHORITY["EPSG","7030"]],
            AUTHORITY["EPSG","6326"]],
        PRIMEM["Greenwich",0],
        UNIT["degree",0.0174532925199433],
        AUTHORITY["EPSG","4326"]],
    PROJECTION["Transverse_Mercator"],
    PARAMETER["latitude_of_origin",0],
    PARAMETER["central_meridian",3],
    PARAMETER["scale_factor",0.9996],
    PARAMETER["false_easting",500000],
    PARAMETER["false_northing",0],
    UNIT["metre",1,
        AUTHORITY["EPSG","9001"]],
    AUTHORITY["EPSG","32631"]]
Note: See TracTickets for help on using tickets.