[PROJ] about projinfo and --spatial-test

Even Rouault even.rouault at spatialys.com
Fri Jan 20 11:15:19 PST 2023


Hi Javier,

which exact projinfo invokation did you use ?

(I'm not that surprised and remember having already seeing that. There 
are various heuristics and filtering that could cause this)

Even

Le 20/01/2023 à 20:11, Javier Jimenez Shaw a écrit :
> Hi
>
> Inspecting the code of projinfo, I see a situation that may show the 
> message
> "Note: using '--spatial-test intersects' would bring more relevant 
> results".
> Looking at the code, it happens only when using "--spatial-test" 
> option with "intersects" or default ("contains") both return 1 
> operation... but different.
> How is that possible? I would expect that "intersects" contains all in 
> "contains".
>
> The code involved is this
>
>         list = CoordinateOperationFactory::create()->createOperations(
>             nnSourceCRS, nnTargetCRS, ctxt);
>         if (!spatialCriterionExplicitlySpecified &&
>             spatialCriterion == 
> CoordinateOperationContext::SpatialCriterion::
>                                     STRICT_CONTAINMENT) {
>             try {
>                 ctxt->setSpatialCriterion(
> CoordinateOperationContext::SpatialCriterion::
>                         PARTIAL_INTERSECTION);
>                 auto list2 =
> CoordinateOperationFactory::create()->createOperations(
>                         nnSourceCRS, nnTargetCRS, ctxt);
> spatialCriterionPartialIntersectionResultCount = list2.size();
>                 if (spatialCriterionPartialIntersectionResultCount == 1 &&
>                     list.size() == 1 &&
>                     list2[0]->nameStr() != list[0]->nameStr()) {
> spatialCriterionPartialIntersectionMoreRelevant = true;
>                 }
>             } catch (const std::exception &) {
>             }
>         }
> ....
>         if (spatialCriterionPartialIntersectionMoreRelevant) {
>            std::cout << "Note: using '--spatial-test intersects' would 
> bring "
>                         "more relevant results."
>                      << std::endl;
>        }
>
> Thanks
> Javier
> .___ ._ ..._ .. . ._.  .___ .. __ . _. . __..  ... .... ._ .__
> Entre dos pensamientos racionales
> hay infinitos pensamientos irracionales.
>
>
> _______________________________________________
> PROJ mailing list
> PROJ at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/proj

-- 
http://www.spatialys.com
My software is free, but my time generally not.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/proj/attachments/20230120/e8b4f2ac/attachment.htm>


More information about the PROJ mailing list