Boost logo

Geometry :

Subject: [ggl] "touches" in boost.geometry?
From: Mateusz Łoskot (mateusz)
Date: 2011-10-20 21:04:53


2011/10/20 Adam Wulkiewicz <adam.wulkiewicz_at_[hidden]>:
> Mateusz ?oskot wrote:
>> 2011/10/20 Adam Wulkiewicz<adam.wulkiewicz_at_[hidden]>:
>>>
>>> I've forgotten about one function - disjoint_with_boundry().
>>
>> It's unclear to me what you mean here.
>> If you mean geometries A and B are disjoint but with possible intersection
>> of
>> their boundaries, then it is OGC touches()
>>
>> http://postgis.org/documentation/manual-svn/ST_Touches.html
>>
>>> Of course names I've used are just examples. Ideally we would have one
>>> function
>>> and template/function parameters would describe the relationship. I
>>> recall that we talked about it earlier and that the first template
>>> parameter can't be used to achieve this goal:
>>>
>>> intersects<without_boundry>(A, B); // impossible
>>
>> I'm a GIS boy, so forgive me if I'm biased, but it is easier for me to
>> speak my language.
>> I sense you mean this (note, it is not OGC contains, but a distinct
>> refinement):
>>
>> http://postgis.org/documentation/manual-svn/ST_ContainsProperly.html
>>
>> Do we agree?
>
> Unfortunately I'm not ;) If I understand correctly ST_ContainsProperly()
> works like GGL's within().

Perhaps. Means, I might have missed something that makes our within()
!= OGC within

> I have something else in mind. If we have two
> objects in space they intersects each other. If we move them in opposite
> directions they will finally be in the point where only boundries touches themselves.
-------------------------------------------------------------------------------------------^^^^^^^^
- exactly.

> Existing implementation of intersects will return true in this border case.

According to world of axioms I live in, this is correct :-)

> It would be nice to have function that returns false.
> The same with disjoint.

If we agree that

intersects(A, B) != disjoint(A, B)

then

> ? ___ ___
> ?| ? | ? |
> ?_|_A | B |
> | |_|_ |__|
> | C |
> |___|
>
> intersects(A, B) -> true
> intersects(A, C) -> true

Correct

> alternative_intersects(A, B) -> false

identical to touches(A, B) -> true

> alternative_intersects(A, C) -> true

identical to intersects(A, C) -> true

> disjoint(A, B) -> false
> disjoint(A, C) -> false

Correct.

> alternative_disjoint(A, B) -> true

Assumption: intersects(A, B) -> true

Thus

alternative_disjoint(A, B) -> true

is identical to

intersects(A, B) -> true && touches(A, B) -> true

which reduces to:

touches(A, B) -> true

because touches implies intersection (of interiors only), though
intersection does not imply touches.

> alternative_disjoint(A, C) -> false

identical to disjoint(A, C) -> false

> touches(A, B) -> true

Correct.

> touches(A, C) -> false

Correct, because intersects(interior(A), interior(C)) -> true,
so A and C don't only touch, but relate more "deeply".

What I'm trying to say is that I can't see why special types of
predicates are needed
as we can solve this situation with the tools based on DE-9IM concept.

Best regards,

-- 
Mateusz Loskot, http://mateusz.loskot.net
Charter Member of OSGeo, http://osgeo.org
Member of ACCU, http://accu.org

Geometry list run by mateusz at loskot.net