<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
Javier,
<blockquote type="cite"
cite="mid:CADRrdKtn4AiFxGo0SP5ZwrzHxCsERXO3rcp5tByYaj7Jf9mQRg@mail.gmail.com">
<div dir="ltr">
<div><br>
</div>
<div>So to force the French vertical crs to use one or the other
we should write something like <br>
</div>
<div><span style="font-family:monospace">
GEOIDMODEL["RAF09",ID["EPSG",8371]]</span></div>
<div>or <br>
</div>
<div><span style="font-family:monospace">
GEOIDMODEL["RAF18",ID["EPSG",8885]]</span></div>
<div><br>
</div>
<div>Is that right? Is that working in PROJ 9.1.0? I tried in
cs2cs, but the output was identical. The log showed that both
were using raf18 tif file.<br>
</div>
</div>
</blockquote>
<p>Yes, currently that will not work</p>
<p>The relevant code is in
src/iso19111/operation/coordinateoperationfactory.cpp at the
bottom of createOperationsGeogToVertFromGeoid() method.</p>
<p> const auto &models = vertDst->geoidModel();<br>
for (const auto &model : models) {<br>
const auto &modelName = model->nameStr();<br>
const auto transformations =<br>
[...]<br>
: authFactory->getTransformationsForGeoid(<br>
modelName,<br>
context.context->getUsePROJAlternativeGridNames()); <br>
</p>
<p>So it uses the AuthorityFactory::getTransformationsForGeoid()
method, which queries the geoid_model database table, to find
which operations are associated with a geoid model name.<br>
When this returns an empty set,
createOperationsGeogToVertFromGeoid() should probably fallback to
querying for a transformation by name using modelName (assuming
official names like "RGF93 v2 to NGF-IGN69 height (2)" are used),
and probably start by instantiating from the identifier(s)
(returned by model->identifiers()) (EPSG:8371) associated with
the model object when it is avaiable. Both can be done with
respectively the createObjectsFromName() and
createCoordinateOperation() methods of AuthorityFactory.</p>
<blockquote type="cite"
cite="mid:CADRrdKtn4AiFxGo0SP5ZwrzHxCsERXO3rcp5tByYaj7Jf9mQRg@mail.gmail.com">
<div dir="ltr">
<div>Could it have many entries to choose one automatically? I
see in the table geoid_model that there are several
"operation_code" for the same "name", and PROJ chooses one.<br>
</div>
</div>
</blockquote>
<p>Yes, PROJ will apply its usual logic (don't ask me to explain in
detail what it is!, or rather use
<a class="moz-txt-link-freetext" href="https://proj.org/operations/operations_computation.html">https://proj.org/operations/operations_computation.html</a> as a first
order approximation of what it does) to select /sort when there
are several operation candidates.<br>
</p>
<p>Even</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>