<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p><br>
    </p>
    <div class="moz-cite-prefix">Le 12/04/2023 à 20:57, Javier Jimenez
      Shaw a écrit :<br>
    </div>
    <blockquote type="cite"
cite="mid:CADRrdKtp=g=QXwpTSQsx20Yzn0S4LZoovyj3452ZmsXvTaEuZg@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="ltr">
        <div>Thanks Even for the quick fix.<br>
        </div>
        <div><br>
        </div>
        <div>Is there a way in C++ to set the option to "NO" or "YES"?</div>
        <div>I saw that I can use proj.ini file and a environment
          variable, that overwrites the value in proj.ini. So if a user
          of my application plays with the environment variables, they
          can change the behaviour (already happened with PROJ_LIB some
          time ago)<br>
        </div>
        <div>I would like to set the behaviour directly in the C++ code.
          Is that possible?</div>
      </div>
    </blockquote>
    <p>You can specify ONLY_BEST=YES/NO in the options argument of
      proj_create_crs_to_crs[_from_pj](). This is what cs2cs does when
      specifying the --only-best switch</p>
    <p>Even<br>
    </p>
    <br>
    <blockquote type="cite"
cite="mid:CADRrdKtp=g=QXwpTSQsx20Yzn0S4LZoovyj3452ZmsXvTaEuZg@mail.gmail.com">
      <div dir="ltr">
        <div><br>
        </div>
        <div>Thanks<br>
        </div>
      </div>
      <br>
      <div class="gmail_quote">
        <div dir="ltr" class="gmail_attr">On Wed, 12 Apr 2023 at 19:24,
          Even Rouault <<a href="mailto:even.rouault@spatialys.com"
            target="_blank" moz-do-not-send="true"
            class="moz-txt-link-freetext">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">
          <div>
            <p>Hi Javier,</p>
            <p>Fixed per <a
                href="https://github.com/OSGeo/PROJ/pull/3707"
                target="_blank" moz-do-not-send="true"
                class="moz-txt-link-freetext">https://github.com/OSGeo/PROJ/pull/3707</a></p>
            <p>doh, I hadn't anticipated that the only_best
              functionality would introduce such complexity. The
              fundamental issue is that the pipeline computation engine
              has subtle behavioral differences depending if you ask it
              to assume that all registered grids are available (which
              is used to get the "universe of possible", from which we
              can see if we are missing the "best" transformation),
              which corresponds projinfo --grid-check known_available
              mode, or if you ask it to discard early transformations
              using grid not available. In the former case, PROJ may
              sometimes not need to synthetize the ballkpark
              transformation when it sees that the extent of the grids
              cover the extent of the CRS. So in the warn-only mode of
              only_best we must actually hybrid the 2 strategies to
              discover both missing best transformation, and get a
              ballpark transformation. Not sure if the above makes
              sense...</p>
            <p>Even<br>
            </p>
            <div>Le 12/04/2023 à 16:46, Javier Jimenez Shaw a écrit :<br>
            </div>
            <blockquote type="cite">
              <div dir="ltr">
                <div>Hi</div>
                <div><br>
                </div>
                <div>I am trying to migrate an application from PROJ
                  9.1.0 to PROJ 9.2.0, and I found a change in
                  behaviour, that I was not expecting in this release:</div>
                <div>Transform a coordinate not having the proper geoid
                  file (the Spanish one in this test). I was expecting
                  that the z component is not changed. But I am getting
                  an error instead, and "* * inf" value.</div>
                <div>I know that ONLY_BEST is there, but I understood
                  that the default was to keep the same behaviour as
                  before, and show a warning asking for a "definition".</div>
                <div>But that is not what I experience. See this command
                  lines:</div>
                <div><br>
                </div>
                <div>
                  <div><span style="font-family:monospace">echo 39 -3 0
                      | PROJ_DEBUG=2 PROJ_NETWORK=OFF cs2cs
                      EPSG:4326+5773 EPSG:4326+5782<br>
                      pj_open_lib(proj.ini): call
                      fopen(/home/jshaw/work/PROJ/install-sh/share/proj/proj.ini)
                      - succeeded<br>
                      pj_open_lib(proj.db): call
                      fopen(/home/jshaw/work/PROJ/install-sh/share/proj/proj.db)
                      - succeeded<br>
                      pj_open_lib(us_nga_egm96_15.tif): call
                      fopen(us_nga_egm96_15.tif) - failed<br>
                      pj_open_lib(egm96_15.gtx): call
                      fopen(egm96_15.gtx) - failed<br>
                      pj_open_lib(es_ign_egm08-rednap.tif): call
                      fopen(es_ign_egm08-rednap.tif) - failed<br>
                      pj_open_lib(es_2019m.asc): call
                      fopen(es_2019m.asc) - failed<br>
                      pj_open_lib(es_2019z.asc): call
                      fopen(es_2019z.asc) - failed<br>
                      pj_open_lib(us_nga_egm96_15.tif): call
                      fopen(us_nga_egm96_15.tif) - failed<br>
                      pj_open_lib(egm96_15.gtx): call
                      fopen(egm96_15.gtx) - failed<br>
                      pj_open_lib(es_ign_egm08-rednap.tif): call
                      fopen(es_ign_egm08-rednap.tif) - failed<br>
                      Attempt to use coordinate operation Inverse of WGS
                      84 to EGM96 height (1) + ETRS89 to Alicante height
                      (1) using ETRS89 to WGS 84 (1) failed. Grid
                      es_ign_egm08-rednap.tif is not available. Consult
                      <a href="https://proj.org/resource_files.html"
                        target="_blank" moz-do-not-send="true"
                        class="moz-txt-link-freetext">https://proj.org/resource_files.html</a>
                      for guidance. Grid us_nga_egm96_15.tif is not
                      available. Consult <a
                        href="https://proj.org/resource_files.html"
                        target="_blank" moz-do-not-send="true"
                        class="moz-txt-link-freetext">https://proj.org/resource_files.html</a>
                      for guidance. This might become an error in a
                      future PROJ major release. Set the ONLY_BEST
                      option to YES or NO. This warning will no longer
                      be emitted (for the current transformation
                      instance).<br>
                      * * inf<br>
                    </span></div>
                  <div><span style="font-family:monospace"><br>
                    </span></div>
                  <div><span style="font-family:monospace"><br>
                    </span></div>
                  <div><span style="font-family:monospace">echo 39 -3 0
                      | PROJ_DEBUG=2 PROJ_ONLY_BEST_DEFAULT=NO
                      PROJ_NETWORK=OFF cs2cs EPSG:4326+5773
                      EPSG:4326+5782<br>
                      pj_open_lib(proj.ini): call
                      fopen(/home/jshaw/work/PROJ/install-sh/share/proj/proj.ini)
                      - succeeded<br>
                      pj_open_lib(proj.db): call
                      fopen(/home/jshaw/work/PROJ/install-sh/share/proj/proj.db)
                      - succeeded<br>
                      pj_open_lib(us_nga_egm96_15.tif): call
                      fopen(us_nga_egm96_15.tif) - failed<br>
                      pj_open_lib(egm96_15.gtx): call
                      fopen(egm96_15.gtx) - failed<br>
                      pj_open_lib(es_ign_egm08-rednap.tif): call
                      fopen(es_ign_egm08-rednap.tif) - failed<br>
                      pj_open_lib(es_2019m.asc): call
                      fopen(es_2019m.asc) - failed<br>
                      pj_open_lib(es_2019z.asc): call
                      fopen(es_2019z.asc) - failed<br>
                      39.00 -3.00 0.00</span></div>
                  <div><span style="font-family:monospace"><br>
                    </span></div>
                  <div><span style="font-family:monospace"><br>
                    </span></div>
                </div>
                <div><span style="font-family:monospace">echo 39 -3 0 |
                    PROJ_DEBUG=2 PROJ_NETWORK=ON cs2cs EPSG:4326+5773
                    EPSG:4326+5782<br>
                    pj_open_lib(proj.ini): call
                    fopen(/home/jshaw/work/PROJ/install-sh/share/proj/proj.ini)
                    - succeeded<br>
                    pj_open_lib(proj.db): call
                    fopen(/home/jshaw/work/PROJ/install-sh/share/proj/proj.db)
                    - succeeded<br>
                    pj_open_lib(us_nga_egm96_15.tif): call
                    fopen(us_nga_egm96_15.tif) - failed<br>
                    pj_open_lib(egm96_15.gtx): call fopen(egm96_15.gtx)
                    - failed<br>
                    pj_open_lib(us_nga_egm96_15.tif): call
                    fopen(us_nga_egm96_15.tif) - failed<br>
                    pj_open_lib(egm96_15.gtx): call fopen(egm96_15.gtx)
                    - failed<br>
                    Using <a
                      href="https://cdn.proj.org/us_nga_egm96_15.tif"
                      target="_blank" moz-do-not-send="true"
                      class="moz-txt-link-freetext">https://cdn.proj.org/us_nga_egm96_15.tif</a><br>
                    pj_open_lib(es_ign_egm08-rednap.tif): call
                    fopen(es_ign_egm08-rednap.tif) - failed<br>
                    pj_open_lib(es_2019m.asc): call fopen(es_2019m.asc)
                    - failed<br>
                    pj_open_lib(es_2019z.asc): call fopen(es_2019z.asc)
                    - failed<br>
                    pj_open_lib(es_ign_egm08-rednap.tif): call
                    fopen(es_ign_egm08-rednap.tif) - failed<br>
                    Using <a
                      href="https://cdn.proj.org/es_ign_egm08-rednap.tif"
                      target="_blank" moz-do-not-send="true"
                      class="moz-txt-link-freetext">https://cdn.proj.org/es_ign_egm08-rednap.tif</a><br>
                    pj_open_lib(us_nga_egm96_15.tif): call
                    fopen(us_nga_egm96_15.tif) - failed<br>
                    pj_open_lib(egm96_15.gtx): call fopen(egm96_15.gtx)
                    - failed<br>
                    Using <a
                      href="https://cdn.proj.org/us_nga_egm96_15.tif"
                      target="_blank" moz-do-not-send="true"
                      class="moz-txt-link-freetext">https://cdn.proj.org/us_nga_egm96_15.tif</a><br>
                    pj_open_lib(es_ign_egm08-rednap.tif): call
                    fopen(es_ign_egm08-rednap.tif) - failed<br>
                    Using <a
                      href="https://cdn.proj.org/es_ign_egm08-rednap.tif"
                      target="_blank" moz-do-not-send="true"
                      class="moz-txt-link-freetext">https://cdn.proj.org/es_ign_egm08-rednap.tif</a><br>
                    39.00 -3.00 0.30</span><br>
                </div>
                <div><br>
                </div>
                <div><br>
                </div>
                <div>The behaviour in 9.1.0 was the same as with "<span
                    style="font-family:monospace">PROJ_ONLY_BEST_DEFAULT=NO"</span><font
                    face="arial,sans-serif">, that is what I was
                    expecting now (plus warning message).</font></div>
                <div><font face="arial,sans-serif"><br>
                  </font></div>
                <div><font face="arial,sans-serif">Am I missing
                    something? Is this a bug?</font></div>
                <div><font face="arial,sans-serif"><br>
                  </font></div>
                <div><font face="arial,sans-serif">Thanks.<br>
                  </font></div>
                <div><br>
                </div>
                <div>
                  <div>
                    <div dir="ltr">
                      <div dir="ltr">
                        <div>.___ ._ ..._ .. . ._.  .___ .. __ . _. .
                          __..  ... .... ._ .__</div>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
              <br>
              <fieldset></fieldset>
              <pre>_______________________________________________
PROJ mailing list
<a href="mailto:PROJ@lists.osgeo.org" target="_blank" moz-do-not-send="true" class="moz-txt-link-freetext">PROJ@lists.osgeo.org</a>
<a href="https://lists.osgeo.org/mailman/listinfo/proj" target="_blank" moz-do-not-send="true" class="moz-txt-link-freetext">https://lists.osgeo.org/mailman/listinfo/proj</a>
</pre>
            </blockquote>
            <pre cols="72">-- 
<a href="http://www.spatialys.com" target="_blank" moz-do-not-send="true" class="moz-txt-link-freetext">http://www.spatialys.com</a>
My software is free, but my time generally not.</pre>
          </div>
        </blockquote>
      </div>
    </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>