<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Hi Javier,</p>
<p>the difference between 3.9.2 and 3.11 that explains what you see
is :
<a class="moz-txt-link-freetext" href="https://github.com/OSGeo/gdal/commit/a4aa0b50154b0558e2677a31dde416452ac07c97">https://github.com/OSGeo/gdal/commit/a4aa0b50154b0558e2677a31dde416452ac07c97</a>
: "<span
class="ws-pre-wrap f5 wb-break-word text-mono prc-Text-Text-0ima0">OGRSpatialReference::importFromEPSG():
tries with ESRI when it looks like an ESRI code, but with a
warning when that succeeds"</span></p>
<p><span
class="ws-pre-wrap f5 wb-break-word text-mono prc-Text-Text-0ima0">The
issue is then that GDAL tries to pass EPSG:102641 to
proj_create() and proj_create() hasn't the above hack.</span></p>
<p><span
class="ws-pre-wrap f5 wb-break-word text-mono prc-Text-Text-0ima0">Fixed
in <a class="moz-txt-link-freetext" href="https://github.com/OSGeo/gdal/pull/12705">https://github.com/OSGeo/gdal/pull/12705</a></span></p>
<p><span
class="ws-pre-wrap f5 wb-break-word text-mono prc-Text-Text-0ima0">Even<br>
</span></p>
<p><br>
</p>
<div class="moz-cite-prefix">Le 04/07/2025 à 19:50, Javier Jimenez
Shaw via gdal-dev a écrit :<br>
</div>
<blockquote type="cite"
cite="mid:CADRrdKsVydnSmGJRpOg0HPxoztzACXk+sUihGZU=FW+1BY72TA@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div dir="ltr">
<div>Hi</div>
<div><br>
</div>
<div>I would like to understand why do I have different
behaviour recognizing a WKT between GDAL 3.9.2 and 3.11.1,
both using PROJ 9.5.0 (using C++)</div>
<div><br>
</div>
<div>There is a clear mistake in the WKT bellow: EPSG:102641 .
It should be ESRI. But the source of the data was wrong, and
we worked with that for a long time.</div>
<div><br>
</div>
<div>PROJCS["NAD_1983_StatePlane_California_I_FIPS_0401_Feet",GEOGCS["GCS_North_American_1983",DATUM["North_American_Datum_1983",</div>
<div>SPHEROID["GRS_1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]],PROJECTION["Lambert_Conformal_Conic_2SP"],</div>
<div>PARAMETER["False_Easting",6561666.666666666],PARAMETER["False_Northing",1640416.666666667],PARAMETER["Central_Meridian",-122],</div>
<div>PARAMETER["Standard_Parallel_1",40],PARAMETER["Standard_Parallel_2",41.66666666666666],PARAMETER["Latitude_Of_Origin",39.33333333333334],</div>
<div>UNIT["Foot_US",0.30480060960121924],AUTHORITY["EPSG","102641"]]</div>
<div><br>
</div>
<div>and yes, ESRI version of WKT does not have AUTHORITY.
Again, the data source is what it is.</div>
<div><br>
</div>
<div>My failing test is because
OGRCreateCoordinateTransformation called with EPSG:4326 and
calStatePlaneCS (created with SetFromUserInput) is failing.</div>
<div>The reason I found is in GetTextRepresentation in
ogrct.cpp. There it checks (if I understood correctly) if
EPSG:102641 and the OGRSpatialReference constructed from the
string are equivalent.</div>
<div>In GDAL 3.9.2 the function IsSame is returning false, and
GetTextRepresentation is trying later with PROJJSON</div>
<div>In GDAL 3.11.1 the function IsSame returns true, and it is
using EPSG:102641, that fails later in OGRProjCT::Initialize
(more in particular in auto targetCRS = proj_create(ctx,
pszTargetSRS);)</div>
<div><br>
</div>
<div>See that I am not changing the version of PROJ: 9.5.0</div>
<div><br>
</div>
<div>I have been looking for any change in GDAL code that would
explain why the wrong "WKT from California" behaves
differently, but I couldn't find anything. The changes in the
code in ogrct.cpp and ogrspatialreference.cpp that I think are
involved are years old (just a thread safe lock changed). But
obviously I am missing something.</div>
<div><br>
</div>
<div>Could you help me?</div>
<div><br>
</div>
<div>Thanks.</div>
<div>Javier</div>
</div>
<br>
<fieldset class="moz-mime-attachment-header"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
gdal-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/gdal-dev">https://lists.osgeo.org/mailman/listinfo/gdal-dev</a>
</pre>
</blockquote>
<pre class="moz-signature" cols="72">--
<a class="moz-txt-link-freetext" href="http://www.spatialys.com">http://www.spatialys.com</a>
My software is free, but my time generally not.</pre>
</body>
</html>