Subject: [ggl] "touches" in boost.geometry?
From: Adam Wulkiewicz (adam.wulkiewicz)
Date: 2011-10-20 20:06:19
Barend Gehrels wrote:
> The "relate" predicate using DE-9IM is certainly planned as it is an
> OGC-SF requirement.
> I don't understand the idea of wrappers exactly. I mean, the predicates
> that there are (intersects, touches, overlaps, within, etc) all have
> specific and exact meanings according to the OGC specifications (are
> they known to all involved here?). So we cannot and should not change them.
> Of course we can add additional algorithms as "meets" if we specify
> their meaning, just as is done by "covered_by" which is also used by
> some databases.
> It is/will be possible to retrieve a boundary using the planned view_as
> function, so you will get the boundary of a polygon and can do
> algorithms with them. That is then considered as a linestring. But for
> the interior-without-boundary that is a little harder I'm afraid.
>> But it probably is possible to pass wrapped geometries. Passing them
>> should allow us to express various relationships and it can be
>> implemented using existing interface.
It's similar to the way how Mateusz described relationships:
>>>> Mateusz Loskot wrote:
>>>>> It's imprecise, though it may be understood as self-contradicting.
>>>>> touches(A, B) is true if and only if
>>>>> intersect(interior(A), interior(B)) is empty
>>>>> intersect(boundary(A), boundary(B)) is non-empty
I thought it would be possible to implement it in this fashion.
bool b = intersects(boundary(g1), interior(g2));
// default - interiors with boundries
b = intersects(g1, g2);
intersection(boundary(poly1), interior(poly2), ls);
Obviously it won't make sense in all cases. E.g.
meets(interior(poly1), interior(poly2)) will return false in all cases.
Geometry list run by mateusz at loskot.net