<html><body><div style="font-family: arial, helvetica, sans-serif; font-size: 12pt; color: #000000"><div>I confirm that my issue was linked to an old IGNF file coming from PROJ4. </div><div><br></div><hr id="zwchr" data-marker="__DIVIDER__"><div data-marker="__HEADERS__"><b>De: </b>"Nicolas Bellaiche" <nicolas.bellaiche@ign.fr><br><b>À: </b>"Even Rouault" <even.rouault@spatialys.com><br><b>Cc: </b>"proj" <PROJ@lists.osgeo.org><br><b>Envoyé: </b>Vendredi 2 Juin 2023 11:14:39<br><b>Objet: </b>Re: [PROJ] PROJ 9 & old syntax +init=<br></div><div><br></div><div data-marker="__QUOTED_TEXT__"><div style="font-family:'arial' , 'helvetica' , sans-serif;font-size:12pt;color:#000000"><br><div><span style="text-decoration:underline" class=""></span><p style="margin:0px"><span style="color:rgb( 0 , 0 , 255 )">1) OK, I found out that the definition in the dataset file includes a conversion from altitude to ellipsoid height which explains the difference.</span></p><p style="margin:0px">2) This is very possible that I have an old IGNF file from PROJ4. I will check that now. Thanks for the clue, I didn't know there was an update on this file.</p><blockquote><div style="color:#000000;font-family:'arial' , 'helvetica' , sans-serif;font-size:12pt;font-style:normal;font-weight:normal;letter-spacing:normal;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none"><div><div class=""><div class=""><div><blockquote class=""><div class=""><div class=""><div class="" style="font-family:'arial' , 'helvetica' , sans-serif;font-size:12pt"><div class=""><div class="" style="font-family:'arial' , 'helvetica' , sans-serif;font-size:12pt"><br></div></div></div></div></div></blockquote></div></div></div></div></div></blockquote><br class="">
    <blockquote>
      <div style="font-family:'arial' , 'helvetica' , sans-serif;font-size:12pt;color:#000000">
        <div>
          <div class="">
            <div class="">
              <div>
                <blockquote class="">
                  <div class="">
                    <div class="">
                      <div style="font-family:'arial' , 'helvetica' , sans-serif;font-size:12pt" class="">
                        <div class="">
                          <div style="font-family:'arial' , 'helvetica' , sans-serif;font-size:12pt" class="">
                            <div class=""><br class="">
                              1.a) NEW SYNTAX: z not correct (grid shift
                              not used)</div>
                            <div class=""><br class="">
                              <span style="font-size:8pt" class=""><strong class=""> echo 600000.00000000
                                  300097.53400000 0.00000000 |
                                   ./bin/cs2cs IGNF:LAMB1 +to
                                  IGNF:UTM31RGF93</strong></span><br class="">
                              <span style="font-size:8pt" class="">452845.19        5583309.40
                                0.00</span><br class="">
                            </div>
                          </div>
                        </div>
                      </div>
                    </div>
                  </div>
                </blockquote>
              </div>
            </div>
          </div>
        </div>
      </div>
    </blockquote>
    Which grid shift file are you refering to ? ntf_r93.gsb ? I assume.
    But this is a horizontal datum shift. No vertical correction. This
    horizontal shift is applied, otherwise you'd get "452843.46   
    5583308.13 0.00" as a result<br>
    <blockquote>
      <div style="font-family:'arial' , 'helvetica' , sans-serif;font-size:12pt;color:#000000">
        <div>
          <div class="">
            <div class="">
              <div>
                <blockquote class="">
                  <div class="">
                    <div class="">
                      <div style="font-family:'arial' , 'helvetica' , sans-serif;font-size:12pt" class="">
                        <div class="">
                          <div style="font-family:'arial' , 'helvetica' , sans-serif;font-size:12pt" class="">
                            <div class=""><br class="">
                              <span style="font-family:'arial' , 'helvetica' , sans-serif;font-size:16px;font-style:normal;font-weight:normal;letter-spacing:normal;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb( 255 , 255 , 255 );text-decoration:none;float:none;display:inline !important" class="">1.b) OLD SYNTAX: z
                                correct:</span></div>
                            <div class=""><br class="">
                              <span style="font-size:8pt" class=""><strong class="">echo 600000.00000000
                                  300097.53400000 0.00000000 |
                                  ./bin/cs2cs +init=IGNF:LAMB1 +to
                                  +init=IGNF:UTM31RGF93</strong></span><br class="">
                              <span style="font-size:8pt" class="">452845.19        5583309.40
                                43.64</span><br class="">
                              <br class="">
                            </div>
                          </div>
                        </div>
                      </div>
                    </div>
                  </div>
                </blockquote>
              </div>
            </div>
          </div>
        </div>
      </div>
    </blockquote>
    <p>I have no idea how you get this result. You should really try
      stopping using the (old) IGNF file with newer PROJ. This is mostly
      in unsupported land. Even when trying, with both PROJ 5.2 and
      latest PROJ master, and with the IGNF file supplied with PROJ 5.2,
      I still get the "452845.19 5583309.40 0.00" result. Did you tweak
      your IGNF file ?</p>
    <p>The only way I can get something close to what you get is by
      composing a manual pipeline using the gr3df97a grid with:<br>
    </p>
    <p>echo  600000.00000000 300097.53400000 0.00000000 |
      PROJ_NETWORK=ON PROJ_DEBUG=3 bin/cct  +proj=pipeline +step +inv
      +proj=lcc +lat_1=49.5 +lat_0=49.5 +lon_0=0 +k_0=0.99987734
      +x_0=600000 +y_0=200000 +a=6378249.2 +rf=293.466021 +pm=paris
      +step +proj=cart +ellps=clrk80ign +step +proj=xyzgridshift
      +grids=fr_ign_gr3df97a.tif +grid_ref=output_crs +ellps=GRS80 +step
      +inv +proj=cart +ellps=GRS80    +step +proj=utm +zone=31
      +ellps=GRS80<br>
        452845.1911   5583309.3959       42.9892           inf<br>
    </p>
    <p>But it seems a bit dubious to have a Z correction term for NTF
      <--> RGF93. And newer PROJ when operating with 2D CRS
      doesn't change the Z value. You may sometimes upgrade your CRS to
      3D by adding the  --3d switch to cs2cs or projinfo, but if the
      transformations available are only 2D ones, that won't make
      miracles.<br>
    </p>
    <p>What does Circe does under the hood for that transformation?<br>
    </p><blockquote><div style="font-family:'arial' , 'helvetica' , sans-serif;font-size:12pt;color:#000000"><div><div class=""><div class=""><div><blockquote class=""><div class=""><div class=""><div style="font-family:'arial' , 'helvetica' , sans-serif;font-size:12pt" class=""><div class=""><div style="font-family:'arial' , 'helvetica' , sans-serif;font-size:12pt" class=""><div class=""><br class="">
                              <br class="">
                              <span style="text-decoration:underline" class="">2) Example where the old syntax
                                gives a wrong result while the new
                                syntax works:</span></div>
                            <br class="">
                            <div class="">2.a) OLD SYNTAX from
                              cartographic to geocentric coordinates /
                              result is wrong</div>
                            <div class=""><br class="">
                              <span style="font-size:8pt" class=""><strong class="">echo 652760.737 7033791.243
                                  43.642 | PROJ_DEBUG=3 ./bin/cs2cs
                                  +init=IGNF:LAMB93 +to +init=IGNF:RGF93</strong></span></div>
                            <div class=""><span style="font-size:8pt;font-family:'new roman' 'new york' 'times' serif" class="">4070355.05        166080.07
                                4891332.24</span></div>
                            <br class="">
                          </div>
                        </div>
                      </div>
                    </div>
                  </div>
                </blockquote>
              </div>
            </div>
          </div>
        </div>
      </div>
    </blockquote>
    <p>I do get "4070327.25<span class="Apple-tab-span" style="white-space:pre"> </span>166078.93
      4891298.61". This really smells like your IGNF file isn't the one
      of PROJ 5.2<br>
    </p>
    <p><br>
    </p>
    <blockquote>
      <div style="font-family:'arial' , 'helvetica' , sans-serif;font-size:12pt;color:#000000">
        <div>
          <div class="">
            <div class="">
              <div>
                <blockquote class="">
                  <div class="">
                    <div class="">
                      <div style="font-family:'arial' , 'helvetica' , sans-serif;font-size:12pt" class="">
                        <div class="">
                          <div style="font-family:'arial' , 'helvetica' , sans-serif;font-size:12pt" class=""><br class="">
                            <div class=""><span style="font-family:'arial' , 'helvetica' , sans-serif;font-size:16px;font-style:normal;font-weight:normal;letter-spacing:normal;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb( 255 , 255 , 255 );text-decoration:none;float:none;display:inline !important" class="">2.b) NEW SYNTAX
                                from cartographic to geocentric
                                coordinates / result is correct</span><br class="">
                            </div>
                            <div class=""><span style="font-family:'arial' , 'helvetica' , sans-serif;font-size:16px;font-style:normal;font-weight:normal;letter-spacing:normal;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb( 255 , 255 , 255 );text-decoration:none;float:none;display:inline !important" class=""><br class="">
                              </span></div>
                            <div class="">
                              <div style="margin:0px;font-style:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:'menlo'" class=""><strong class="">echo
                                  652760.737 7033791.243 43.642 |
                                  PROJ_DEBUG=3 ./bin/cs2cs IGNF:LAMB93
                                  +to IGNF:RGF93<span class="Apple-converted-space"> </span></strong></div>
                              <div style="margin:0px;font-style:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:'menlo'" class="">4070327.25<span class="Apple-tab-span" style="white-space:pre"> </span>166078.93
                                4891298.61</div>
                              <div style="margin:0px;font-style:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:'menlo'" class=""><br class="">
                              </div>
                              <div style="margin:0px;font-style:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:'menlo'" class=""><br class="">
                              </div>
                              <div style="margin:0px;font-style:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:'menlo'" class=""><br class="">
                              </div>
                            </div>
                          </div>
                          <br class="">
                        </div>
                      </div>
                    </div>
                    _______________________________________________<br class="">
                    PROJ mailing list<br class="">
                    <a href="mailto:PROJ@lists.osgeo.org" rel="nofollow noopener noreferrer nofollow noopener noreferrer nofollow noopener noreferrer" target="_blank">PROJ@lists.osgeo.org</a><br class="">
                    <a href="https://lists.osgeo.org/mailman/listinfo/proj" rel="nofollow noopener noreferrer nofollow noopener noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/proj</a><br class="">
                  </div>
                </blockquote>
              </div>
              <br class="">
            </div>
          </div>
          <br>
        </div>
      </div>
      <br>
      <fieldset class="moz-mime-attachment-header"></fieldset>
      <pre class="moz-quote-pre">_______________________________________________
PROJ mailing list
<a href="mailto:PROJ@lists.osgeo.org" rel="nofollow noopener noreferrer nofollow noopener noreferrer" target="_blank">PROJ@lists.osgeo.org</a>
<a href="https://lists.osgeo.org/mailman/listinfo/proj" rel="nofollow noopener noreferrer nofollow noopener noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/proj</a>
</pre>
    </blockquote>
    <pre class="moz-signature">-- 
<a href="http://www.spatialys.com" rel="nofollow noopener noreferrer nofollow noopener noreferrer" target="_blank">http://www.spatialys.com</a>
My software is free, but my time generally not.</pre><br></div></div><br>_______________________________________________<br>PROJ mailing list<br>PROJ@lists.osgeo.org<br>https://lists.osgeo.org/mailman/listinfo/proj<br></div></div></body></html>