[gdal-dev] full projection parameters in geotiff

Kirk Waters - NOAA Federal kirk.waters at noaa.gov
Fri Dec 20 08:32:15 PST 2024


Even,
Thank you very much, I'll test that out. As much as I like the idea of the
authority codes, I've seen enough examples where software has an incorrect
lookup of what the parameters are for a code or simply doesn't know the
code. It would be nice if they all leveraged Proj, but they don't. Even if
they did, I've seen many of my user base being slow (20 years in one case)
to upgrade software, so newer codes won't be recognized.

Kirk


On Fri, Dec 20, 2024 at 11:07 AM Even Rouault <even.rouault at spatialys.com>
wrote:

> Kirk,
>
> Yes if there's an EPSG code for the CRS, GDAL avoids going through
> defining all the parameters. That limits the risk of self-contradicting
> definitions, and readers being confused by what is authoritative.
>
> The following (untested (TM)) patch should accomplish what you want:
>
> diff --git a/frmts/gtiff/gt_wkt_srs.cpp b/frmts/gtiff/gt_wkt_srs.cpp
> index 22eabfcd38..5a089142f8 100644
> --- a/frmts/gtiff/gt_wkt_srs.cpp
> +++ b/frmts/gtiff/gt_wkt_srs.cpp
> @@ -2213,7 +2213,8 @@ int GTIFSetFromOGISDefnEx(GTIF *psGTIF,
> OGRSpatialReferenceH hSRS,
>              GTIFKeySet(psGTIF, ProjectedCSTypeGeoKey, TYPE_SHORT, 1,
> nPCS);
>          }
>      }
> -    else if (poSRSCompatibleOfWKT1->IsGeocentric())
> +
> +    if (poSRSCompatibleOfWKT1->IsGeocentric())
>      {
>          GTIFKeySet(psGTIF, GTModelTypeGeoKey, TYPE_SHORT, 1,
>                     ModelTypeGeocentric);
>
> Even
>
> -- http://www.spatialys.com
> My software is free, but my time generally not.
> Butcher of all kinds of standards, open or closed formats. At the end, this is just about bytes.
> Mood of the day: "Bien entendu, on peut sauter sur sa chaise comme un cabri en disant : les standards ! les standards ! les standards ! Mais ça n’aboutit à rien et ça ne signifie rien." ~ dixit De Gaulle
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20241220/f28bbc71/attachment.htm>


More information about the gdal-dev mailing list