<div dir="ltr"><div>Even,</div><div>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.</div><div><br></div><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Kirk</div></div></div><br></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Fri, Dec 20, 2024 at 11:07 AM Even Rouault <<a href="mailto:even.rouault@spatialys.com">even.rouault@spatialys.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><u></u>
<div>
Kirk,<br>
<p>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.</p>
<p>The following (untested (TM)) patch should accomplish what you
want:</p>
<p>diff --git a/frmts/gtiff/gt_wkt_srs.cpp
b/frmts/gtiff/gt_wkt_srs.cpp<br>
index 22eabfcd38..5a089142f8 100644<br>
--- a/frmts/gtiff/gt_wkt_srs.cpp<br>
+++ b/frmts/gtiff/gt_wkt_srs.cpp<br>
@@ -2213,7 +2213,8 @@ int GTIFSetFromOGISDefnEx(GTIF *psGTIF,
OGRSpatialReferenceH hSRS,<br>
GTIFKeySet(psGTIF, ProjectedCSTypeGeoKey, TYPE_SHORT,
1, nPCS);<br>
}<br>
}<br>
- else if (poSRSCompatibleOfWKT1->IsGeocentric())<br>
+<br>
+ if (poSRSCompatibleOfWKT1->IsGeocentric())<br>
{<br>
GTIFKeySet(psGTIF, GTModelTypeGeoKey, TYPE_SHORT, 1,<br>
ModelTypeGeocentric);<br>
</p>
<br>
<p>Even<span style="white-space:pre-wrap">
</span></p>
<pre cols="72">--
<a href="http://www.spatialys.com" target="_blank">http://www.spatialys.com</a>
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</pre>
</div>
</blockquote></div>