<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p><br>
</p>
<div class="moz-cite-prefix">Le 28/01/2022 à 13:08, Lesparre, Jochem
a écrit :<br>
</div>
<blockquote type="cite"
cite="mid:AM0P192MB0482D3E9A8BE244DD1A569CDEF229@AM0P192MB0482.EURP192.PROD.OUTLOOK.COM">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="Generator" content="Microsoft Word 15 (filtered
medium)">
<style>@font-face
{font-family:Wingdings;
panose-1:5 0 0 0 0 0 0 0 0 0;}@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
{mso-style-priority:34;
margin-top:0cm;
margin-right:0cm;
margin-bottom:0cm;
margin-left:36.0pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}span.EmailStyle25
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:windowtext;}.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}div.WordSection1
{page:WordSection1;}ol
{margin-bottom:0cm;}ul
{margin-bottom:0cm;}</style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
<div class="WordSection1">
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"
lang="EN-GB">Hi Even,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"
lang="EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"
lang="EN-GB">Thanks for the quick and clear reply. I now
found the description for this use case at proj.org, which
explicitly mentions the naptrans grid of the Netherlands as
example (sorry for not RTFM). I have some remaining
questions, though:<o:p></o:p></span></p>
<ul style="margin-top:0cm" type="disc">
<li class="MsoListParagraph"
style="margin-left:0cm;mso-list:l3 level1 lfo3"><span
style="mso-fareast-language:EN-US" lang="EN-GB">Why is
this use case not more common? This [1] was the standard
way to get a transformation to a national compound CRS in
PROJ4, right?</span></li>
</ul>
</div>
</blockquote>
<p>Looking at the 'epsg' file that was delivered in PROJ < 6,
there's no single entry having both +nadgrids and +geoidgrids in
it. I'm not completely sure if the fact that the order of those
operations was the one you expected was a design decision or just
the result of a 50% 50% dice throw.</p>
<p>Hum but now I'm lost, if doing EPSG:4937 to "+proj=sterea
+lat_0=52.156160556 +lon_0=5.387638889 +k=0.9999079 +x_0=155000
+y_0=463000 +ellps=bessel +nadgrids=rdtrans2018.gsb +units=m
+geoidgrids=naptrans2018.gtx +vunits=m +no_defs"</p>
<p>- with recent PROJ, it does ... +step +inv +proj=vgridshift
+grids=naptrans2018.gtx +multiplier=1 +step +inv +proj=hgridshift
+grids=nl_nsgi_rdtrans2018.tif , so vertical adjustment then
horizontal <br>
</p>
<p>- but my understanding of the PROJ <6 code is that it does in
the reverse order.</p>
<p>playing with cs2cs & cct, I can actually confirm this.
There's a difference in vertical values of the order of a few
millimeters, whereas if I modify the pipeline to do horizontal
then vertical, I get the PROJ < 6 results with a sub-millimeter
precision. Who is right, who is wrong: I give up. At that point
we probably just need to accept the discrepancy as nobody raised
it. Bottom line: use cct instead of cs2cs to unambiguously control
the order of operations.<br>
</p>
<p>Actually I found an older thread about that :
<a class="moz-txt-link-freetext" href="https://lists.osgeo.org/pipermail/proj/2019-May/008526.html">https://lists.osgeo.org/pipermail/proj/2019-May/008526.html</a> and it
already gave me tons of headaches...<br>
</p>
<p>using the EPSG:7415 code gives the expected result (but I now see
that it is because it uses the nlgeo2018 grid)<br>
</p>
<p>$ echo 53 6 0 | PROJ_NETWORK=ON PROJ_LIB=data bin/cs2cs -f "%.4f"
EPSG:4937 EPSG:7415<br>
196139.4316 557179.0261 -41.6949</p>
<p>whereas using the PROJ.4 string for EPSG:7415 results (in PROJ
>= 6) in the reverse order for horizontal & vertical
adjustments</p>
<p>$ echo 53 6 0 | PROJ_NETWORK=ON PROJ_LIB=data bin/cs2cs -f "%.4f"
EPSG:4937 +to "+proj=sterea +lat_0=52.156160556 +lon_0=5.387638889
+k=0.9999079 +x_0=155000 +y_0=463000 +ellps=bessel
+nadgrids=rdtrans2018.gsb +units=m +geoidgrids=naptrans2018.gtx
+vunits=m +no_defs +type=crs"<br>
196139.4316 557179.0261 -41.6982<br>
<br>
</p>
<blockquote type="cite"
cite="mid:AM0P192MB0482D3E9A8BE244DD1A569CDEF229@AM0P192MB0482.EURP192.PROD.OUTLOOK.COM">
<div class="WordSection1">
<ul style="margin-top:0cm" type="disc">
<li class="MsoListParagraph"
style="margin-left:0cm;mso-list:l3 level1 lfo3"><span
style="mso-fareast-language:EN-US" lang="EN-GB">Since the
CRS of the GeoTIFF is the source-crs [2], does this mean
that other software will would show the grid values at the
latlon of the source-crs instead of at the latlon of the
interpolation-crs?</span></li>
</ul>
</div>
</blockquote>
On reflection, it might be better to have the GeoTIFF SRS be the
interpolation CRS (like in the VERTICAL_TO_VERTICAL case, but in
that case there's no other sane choice), an explicit
source_crs_code=7931 and interpolation_crs_wkt=.... The
<a class="moz-txt-link-freetext" href="https://proj.org/specifications/geodetictiffgrids.html">https://proj.org/specifications/geodetictiffgrids.html</a> page should
be amended to document that, and the validation script too. And
perhaps the conversion script too if that's thought to be a
not-so-rare use case.<br>
<blockquote type="cite"
cite="mid:AM0P192MB0482D3E9A8BE244DD1A569CDEF229@AM0P192MB0482.EURP192.PROD.OUTLOOK.COM">
<div class="WordSection1">
<ul style="margin-top:0cm" type="disc">
<li class="MsoListParagraph"
style="margin-left:0cm;mso-list:l3 level1 lfo3"><span
style="mso-fareast-language:EN-US" lang="EN-GB"><o:p></o:p></span><br>
</li>
</ul>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"
lang="EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"
lang="EN-GB">Additional question on names and aliases:<o:p></o:p></span></p>
<ul style="margin-top:0cm" type="disc">
<li class="MsoListParagraph"
style="margin-left:0cm;mso-list:l0 level1 lfo6"><span
style="mso-fareast-language:EN-US" lang="EN-GB">For
EPSG:4289, the EPSG registry uses the name “Amersfoort”.
However, we (the official authority of this CRS) never use
this name. Since the name “Amersfoort” has been in EPSG
for a long time, EPSG preferred not to correct this, but
to add the official name “RD Bessel” as an alias in the
EPSG registry. Can I use the official alias “RD Bessel”
instead of the EPSG name “Amersfoort” for the WKT strings
and/or the description in the metadata of the Geodetic
TIFF Grids?
</span></li>
</ul>
</div>
</blockquote>
<p>I guess that's OK, adding just a bit more confusion to an already
super confusing topic</p>
<p>Note: I'm not sure if it is a formatting issue when writing the
email, but the value of the interpolation_crs_wkt item is wrong as
it lacks double quoting around strings.<br>
</p>
<br>
<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>