[PROJ] about projinfo and --spatial-test

Javier Jimenez Shaw j1 at jimenezshaw.com
Fri Jan 20 11:51:43 PST 2023


Thanks Even

Unfortunately I do not have any example. I was just reading the code of
projinfo to see how to get CoordinateOperations in C++.

.___ ._ ..._ .. . ._.  .___ .. __ . _. . __..  ... .... ._ .__
Entre dos pensamientos racionales
hay infinitos pensamientos irracionales.



On Fri, 20 Jan 2023 at 20:15, Even Rouault <even.rouault at spatialys.com>
wrote:

> 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 listPROJ at lists.osgeo.orghttps://lists.osgeo.org/mailman/listinfo/proj
>
> -- http://www.spatialys.com
> My software is free, but my time generally not.
>
> _______________________________________________
> PROJ mailing list
> PROJ at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/proj
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/proj/attachments/20230120/e898d2eb/attachment-0001.htm>


More information about the PROJ mailing list