<div dir="ltr">In the DK registry we used descriptive names, rather than numbers to refer to the transformations taking legacy systems to ETRS89. Essentially these transformations amounted to CRS definitions. Is it safe to assume a "crs_code" is strictly numeric?</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Den ons. 10. jan. 2024 kl. 20.46 skrev Meyer, Jesse R. (GSFC-618.0)[SCIENCE SYSTEMS AND APPLICATIONS INC] via gdal-dev <<a href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a>>:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="msg6706650260504414409">
<div lang="EN-US" style="overflow-wrap: break-word;">
<div class="m_6706650260504414409WordSection1">
<p class="MsoNormal">To be clear, I wasn’t advocating for less functionality. I wanted more! We know what our constraints are, and we’ve had significant issues in the past with slightly different projection related strings producing surprisingly different
outputs. Keying off a single value simplifies a tremendous amount for us, with a slight loss in generality and increase in error modes.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">For now, the logic resembles:<u></u><u></u></p>
<p class="MsoNormal">Crs_string = “EPSG:{crs_code}”<u></u><u></u></p>
<p class="MsoNormal">If crs_code > 32767:<u></u><u></u></p>
<p class="MsoNormal"> Crs_string = “ESRI:{crs_code}”<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">SetFromUserInput(crs_string)<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">The lack of such a function implied that there were overloaded values between the authorities (and perhaps, there were more than 2).<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Jesse<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<div style="border-right:none;border-bottom:none;border-left:none;border-top:1pt solid rgb(181,196,223);padding:3pt 0in 0in">
<p class="MsoNormal"><b><span style="font-size:12pt;color:black">From: </span></b><span style="font-size:12pt;color:black">Javier Jimenez Shaw <<a href="mailto:j1@jimenezshaw.com" target="_blank">j1@jimenezshaw.com</a>><br>
<b>Date: </b>Wednesday, January 10, 2024 at 1:55 PM<br>
<b>To: </b>Even Rouault <<a href="mailto:even.rouault@spatialys.com" target="_blank">even.rouault@spatialys.com</a>><br>
<b>Cc: </b>"Meyer, Jesse R. (GSFC-618.0)[SCIENCE SYSTEMS AND APPLICATIONS INC]" <<a href="mailto:jesse.r.meyer@nasa.gov" target="_blank">jesse.r.meyer@nasa.gov</a>>, "<a href="mailto:gdal-dev@lists.osgeo.org" target="_blank">gdal-dev@lists.osgeo.org</a>" <<a href="mailto:gdal-dev@lists.osgeo.org" target="_blank">gdal-dev@lists.osgeo.org</a>><br>
<b>Subject: </b>Re: [gdal-dev] [EXTERNAL] Re: Lack of srs importFromESRI integer function<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<table border="1" cellspacing="0" cellpadding="0" align="left" style="border:1.5pt solid black">
<tbody>
<tr>
<td width="100%" style="width:100%;border:none;background:rgb(255,235,156);padding:3.75pt">
<p class="MsoNormal">
<b><span style="font-size:10pt;color:black">CAUTION:</span></b><span style="color:black">
</span><span style="font-size:10pt;color:black">This email originated from outside of NASA. Please take care when clicking links or opening attachments. Use the "Report Message" button to report suspicious messages to the NASA SOC.</span><span style="color:black">
</span><u></u><u></u></p>
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal" style="margin-bottom:12pt"><br>
<br>
<u></u><u></u></p>
<div>
<div>
<div>
<p class="MsoNormal">This is the discussion I have with my colleagues every time (but with EPSG). The wanted to use an integer, and I ask them again and again to use a better notation like "EPSG:{code}". The method that Even mentions, SetFromUserInput, works
with "EPSG:code", with "ESRI:code", with a WKT, with a PROJJSON, etc. It makes the management of the CRS much easier. When you need something more complicated than an ESRI code, if your API is only ready for an integer value... you have a lot of things to
refactor (months of work, I can tell you).<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Technically ESRI and EPSG there are overlapping. As you can see in this link there are some non-deprecated ESRI codes below 33000:<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><a href="https://crs-explorer.proj.org/?ignoreWorld=false&allowDeprecated=false&authorities=ESRI&activeTypes=PROJECTED_CRS,GEOGRAPHIC_2D_CRS,GEOGRAPHIC_3D_CRS,GEOCENTRIC_CRS,GEODETIC_CRS,VERTICAL_CRS,COMPOUND_CRS&map=osm" target="_blank">https://crs-explorer.proj.org/?ignoreWorld=false&allowDeprecated=false&authorities=ESRI&activeTypes=PROJECTED_CRS,GEOGRAPHIC_2D_CRS,GEOGRAPHIC_3D_CRS,GEOCENTRIC_CRS,GEODETIC_CRS,VERTICAL_CRS,COMPOUND_CRS&map=osm</a><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">And many more if you "Allow deprecated".<u></u><u></u></p>
</div>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<div>
<p class="MsoNormal">On Wed, 10 Jan 2024 at 19:01, Even Rouault via gdal-dev <<a href="mailto:gdal-dev@lists.osgeo.org" target="_blank">gdal-dev@lists.osgeo.org</a>> wrote:<u></u><u></u></p>
</div>
<blockquote style="border-top:none;border-right:none;border-bottom:none;border-left:1pt solid rgb(204,204,204);padding:0in 0in 0in 6pt;margin-left:4.8pt;margin-right:0in">
<div>
<p><u></u> <u></u></p>
<div>
<p class="MsoNormal">Le 10/01/2024 à 18:52, Meyer, Jesse R. (GSFC-618.0)[SCIENCE SYSTEMS AND APPLICATIONS INC] a écrit :<u></u><u></u></p>
</div>
<blockquote style="margin-top:5pt;margin-bottom:5pt">
<div>
<p class="MsoNormal">Thanks Even, we’ll try that.<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">Are there any known integer values that ESRI and EPSG conflate? If not, it would be convenient to simply pass in an integer to a single API function and be done with it.<u></u><u></u></p>
</div>
</blockquote>
<p>I believe not. Codes in the [1,32767] range should lead to equivalent definitions under both authorities. But when they are really the same, to save space and confusion to users, they are not imported under the ESRI authority and are only available under
the EPSG ones. So codes in the [1,32767] under the ESRI authorities are basically for CRS names that are slightly different spelled by ESRI (but otherwise with a definition compatible of the EPSG one). There are also very ancient deprecated CRS that were imported
from EPSG, but were deprecated by EPSG so long ago that they are not in the EPSG database anymore (like
<a href="https://spatialreference.org/ref/esri/31491/" target="_blank">https://spatialreference.org/ref/esri/31491/</a>).<u></u><u></u></p>
<p>But there's no only EPSG and ESRI in life :-) The IAU authority for example uses numeric code in the ranges of what could be used by EPSG or ESRI.<u></u><u></u></p>
<p>So it is really the tuple (authority_name,code) that conveys a primary key.<u></u><u></u></p>
<blockquote style="margin-top:5pt;margin-bottom:5pt">
<div>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">Jesse<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<div style="border-right:none currentcolor;border-bottom:none currentcolor;border-left:none currentcolor;border-top:1pt solid currentcolor;padding:3pt 0in 0in">
<p class="MsoNormal"><b><span style="font-size:12pt;color:black">From:
</span></b><span style="font-size:12pt;color:black">Even Rouault <a href="mailto:even.rouault@spatialys.com" target="_blank">
<even.rouault@spatialys.com></a><br>
<b>Date: </b>Wednesday, January 10, 2024 at 12:48 PM<br>
<b>To: </b>"Meyer, Jesse R. (GSFC-618.0)[SCIENCE SYSTEMS AND APPLICATIONS INC]" <a href="mailto:jesse.r.meyer@nasa.gov" target="_blank">
<jesse.r.meyer@nasa.gov></a>, <a href="mailto:gdal-dev@lists.osgeo.org" target="_blank">
"gdal-dev@lists.osgeo.org"</a> <a href="mailto:gdal-dev@lists.osgeo.org" target="_blank">
<gdal-dev@lists.osgeo.org></a><br>
<b>Subject: </b>[EXTERNAL] Re: [gdal-dev] Lack of srs importFromESRI integer function</span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<table border="1" cellspacing="0" cellpadding="0" align="left" style="border:1.5pt solid black">
<tbody>
<tr>
<td width="100%" style="width:100%;border:none;background:rgb(255,235,156);padding:3.75pt">
<p class="MsoNormal">
<b><span style="font-size:10pt;color:black">CAUTION:</span></b><span style="color:black">
</span><span style="font-size:10pt;color:black">This email originated from outside of NASA. Please take care when clicking links or opening attachments. Use the "Report Message" button to report suspicious messages to the NASA SOC.</span><span style="color:black">
</span><u></u><u></u></p>
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal" style="margin-bottom:12pt"><u></u> <u></u></p>
<div>
<p>Jesse,<u></u><u></u></p>
<p>You can use SetFromUserInput("ESRI:XXXX") . ImportFromEPSG(code) more or less does SetFromUserInput("EPSG:{code}")<u></u><u></u></p>
<p>Even<u></u><u></u></p>
<div>
<p class="MsoNormal">Le 10/01/2024 à 18:44, Meyer, Jesse R. (GSFC-618.0)[SCIENCE SYSTEMS AND APPLICATIONS INC] via gdal-dev a écrit :<u></u><u></u></p>
</div>
<blockquote style="margin-top:5pt;margin-bottom:5pt">
<p class="MsoNormal">Hi,<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">Our team has moved away from providing geographic / projected CRS codes as strings and prefer using integers where possible. However, in the C++ API, I only see an integer based
importFromEPSG function, which doesn’t appear to accept ESRI codes (crs not found error message). We’re targeting an Albers projection which is distinguished by an ESRI integer.<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">Curiously, the proj database doesn’t seem to make this distinction – the table column is simply ‘code’ and I can find the projection row manually, alongside EPSG projections.<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">Can such a function be provided by the API (if it doesn’t already exist – I couldn’t find it – there are no integer overloads of importFromESRI)?<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">Please advise -- thanks,<u></u><u></u></p>
<p class="MsoNormal">Jesse<u></u><u></u></p>
<p class="MsoNormal" style="margin-bottom:12pt"><u></u> <u></u></p>
<pre>_______________________________________________<u></u><u></u></pre>
<pre>gdal-dev mailing list<u></u><u></u></pre>
<pre><a href="mailto:gdal-dev@lists.osgeo.org" target="_blank">gdal-dev@lists.osgeo.org</a><u></u><u></u></pre>
<pre><a href="https://lists.osgeo.org/mailman/listinfo/gdal-dev" target="_blank">https://lists.osgeo.org/mailman/listinfo/gdal-dev</a><u></u><u></u></pre>
</blockquote>
<pre>-- <u></u><u></u></pre>
<pre><a href="http://www.spatialys.com/" target="_blank">http://www.spatialys.com</a><u></u><u></u></pre>
<pre>My software is free, but my time generally not.<u></u><u></u></pre>
</div>
</div>
</blockquote>
<pre>-- <u></u><u></u></pre>
<pre><a href="http://www.spatialys.com/" target="_blank">http://www.spatialys.com</a><u></u><u></u></pre>
<pre>My software is free, but my time generally not.<u></u><u></u></pre>
</div>
<p class="MsoNormal">_______________________________________________<br>
gdal-dev mailing list<br>
<a href="mailto:gdal-dev@lists.osgeo.org" target="_blank">gdal-dev@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/gdal-dev" target="_blank">https://lists.osgeo.org/mailman/listinfo/gdal-dev</a><u></u><u></u></p>
</blockquote>
</div>
</div>
</div>
</div>
_______________________________________________<br>
gdal-dev mailing list<br>
<a href="mailto:gdal-dev@lists.osgeo.org" target="_blank">gdal-dev@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/gdal-dev" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/gdal-dev</a><br>
</div></blockquote></div>