[PROJ] about projinfo and --spatial-test
Even Rouault
even.rouault at spatialys.com
Fri Jan 20 12:02:17 PST 2023
Ah, I read your message too fast. I see I added that in
https://github.com/OSGeo/PROJ/commit/f50221ed6606a67ef0354cacd449f02aca3faba7.
Unfortunately there is no corresponding test and my memories have
obviously vanished. This is perhaps a situation where --spatial-test
intersects would return a non-ballpark operation and without it a
ballpark operation. Although I suspect this might be more subtle than that.
Le 20/01/2023 à 20:51, Javier Jimenez Shaw a écrit :
> 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 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.
>
> _______________________________________________
> 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/6e914bfe/attachment.htm>
More information about the PROJ
mailing list