<div dir="ltr"><div>Thanks Even</div><div><br></div><div>Unfortunately I do not have any example. I was just reading the code of projinfo to see how to get CoordinateOperations in C++.</div><div><br></div><div><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature">.___ ._ ..._ .. . ._. .___ .. __ . _. . __.. ... .... ._ .__<br>Entre dos pensamientos racionales <br>hay infinitos pensamientos irracionales.<br><br></div></div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, 20 Jan 2023 at 20:15, Even Rouault <<a href="mailto:even.rouault@spatialys.com">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>which exact projinfo invokation did you use ?</p>
<p>(I'm not that surprised and remember having already seeing that.
There are various heuristics and filtering that could cause this)</p>
<p>Even<br>
</p>
<div>Le 20/01/2023 à 20:11, Javier Jimenez
Shaw a écrit :<br>
</div>
<blockquote type="cite">
<div dir="ltr">
<div>Hi</div>
<div><br>
</div>
<div>Inspecting the code of projinfo, I see a situation that may
show the message <br>
</div>
<div>"Note: using '--spatial-test intersects' would bring more
relevant results".</div>
<div>Looking at the code, it happens only when using
"--spatial-test" option with "intersects" or default
("contains") both return 1 operation... but different.</div>
<div>How is that possible? I would expect that "intersects"
contains all in "contains".<br>
</div>
<div><br>
</div>
<div>The code involved is this</div>
<div><br>
</div>
<div><span> list =
CoordinateOperationFactory::create()->createOperations(<br>
nnSourceCRS, nnTargetCRS, ctxt);<br>
if (!spatialCriterionExplicitlySpecified &&<br>
spatialCriterion ==
CoordinateOperationContext::SpatialCriterion::<br>
STRICT_CONTAINMENT) {<br>
try {<br>
ctxt->setSpatialCriterion(<br>
CoordinateOperationContext::SpatialCriterion::<br>
PARTIAL_INTERSECTION);<br>
auto list2 =<br>
CoordinateOperationFactory::create()->createOperations(<br>
nnSourceCRS, nnTargetCRS, ctxt);<br>
spatialCriterionPartialIntersectionResultCount =
list2.size();<br>
if
(spatialCriterionPartialIntersectionResultCount == 1
&&<br>
list.size() == 1 &&<br>
list2[0]->nameStr() !=
list[0]->nameStr()) {<br>
spatialCriterionPartialIntersectionMoreRelevant = true;<br>
}<br>
} catch (const std::exception &) {<br>
}<br>
}</span></div>
<div><span></span></div>
<div><span>....</span></div>
<div><span> if
(spatialCriterionPartialIntersectionMoreRelevant) {<br>
std::cout << "Note: using '--spatial-test
intersects' would bring "<br>
"more relevant results."<br>
<< std::endl;<br>
}</span></div>
<div><br>
</div>
<div>Thanks</div>
<div>Javier<br>
</div>
<div>
<div dir="ltr">.___ ._ ..._ .. . ._. .___
.. __ . _. . __.. ... .... ._ .__<br>
Entre dos pensamientos racionales <br>
hay infinitos pensamientos irracionales.<br>
<br>
</div>
</div>
</div>
<br>
<fieldset></fieldset>
<pre>_______________________________________________
PROJ mailing list
<a href="mailto:PROJ@lists.osgeo.org" target="_blank">PROJ@lists.osgeo.org</a>
<a href="https://lists.osgeo.org/mailman/listinfo/proj" target="_blank">https://lists.osgeo.org/mailman/listinfo/proj</a>
</pre>
</blockquote>
<pre cols="72">--
<a href="http://www.spatialys.com" target="_blank">http://www.spatialys.com</a>
My software is free, but my time generally not.</pre>
</div>
_______________________________________________<br>
PROJ mailing list<br>
<a href="mailto:PROJ@lists.osgeo.org" target="_blank">PROJ@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/proj" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/proj</a><br>
</blockquote></div>