Skip to content

Wrong handling of angular units in GeoTIFF #10154

@agisoft-metashape

Description

@agisoft-metashape

What is the bug?

When reading SRS definition from GeoTIFF file with AngularGrad units GDAL seem to incorrectly interpret ProjNatOriginLatGeoKey parameter as if it was written in degrees.

But according to GeoTIFF specification angular projection parameters (including ProjNatOriginLatGeoKey) shall have units specified by the GeogAngularUnitsGeoKey:
https://docs.ogc.org/is/19-008r4/19-008r4.html#_map_projection_parameters_coordinate_operation_parameters

Steps to reproduce the issue

A test image in NTF (Paris) / Lambert Sud France (EPSG:27563) projection: test_27563_tif.zip

listgeo utility lists the ProjNatOriginLatGeoKey value in angular units (grads) as required by GeoTIFF specification:

$ listgeo test_27563.tif

...
      GeogAngularUnitsGeoKey (Short,1): Angular_Grad
      GeogAngularUnitSizeGeoKey (Double,1): 0.0157079633     
...
      ProjNatOriginLatGeoKey (Double,1): 49               
...

But gdalinfo (GDAL 3.8.4) prints incorrect value for this parameter:

$ gdalinfo test_27563.tif

...
                PARAMETER["Latitude of natural origin",54.4444444444444,
                    ANGLEUNIT["grad",0.015707963267949],
                    ID["EPSG",8801]],
...

Complete listgeo output: test_27563_listgeo.txt
Complete gdalinfo output: test_27563_gdalinfo.txt

Versions and provenance

GDAL 3.8.4, released 2024/02/08 running on Windows 10

Additional context

No response

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions