# Geometry :

Subject: Re: [geometry] intersection of two rings
From: Ollmann, Tobias (Tobias.Ollmann_at_[hidden])
Date: 2016-04-12 07:01:11

Ok, thank you.
I'll try to find another solution.

Regards
Tobias

-----Ursprüngliche Nachricht-----
Von: Geometry [mailto:geometry-bounces_at_[hidden]] Im Auftrag von Barend Gehrels
Gesendet: Sonntag, 10. April 2016 18:28
An: Boost.Geometry library mailing list
Betreff: Re: [geometry] intersection of two rings

Hi Tobias,

Op 6-4-2016 om 10:53 schreef Ollmann, Tobias:
> First of all, thank you for developing this great library. I found it
> last week and it solved some of my problems at once :)

Thanks, good to hear that!

>
> But now I have a problem when calculating the intersection points of two linear rings.
> The rings share a common line which yields two intersection points
> while it should only give one (in my opinion)
>
> The two rings are:
> 0,10 - 0,30 - 30,30 - 30,10 ( - 0,10)
> 10,10 - 10,20 - 40,20 - 40,0 - 20,0 - 20,10 ( - 10,10)
>
> The found intersections are:
> 30,20
> 20,10
> 10,10
>
> Is this a bug or expected behavior?
> I would expect that the number of intersections of two closed rings is always even, as one ring has to 'enter' the other as often as it 'leaves' it.

It is expected behaviour. A shared egde will result into two separate intersection points. So the number is not always even. Also, when one polygon touches another in one point, the number of points is not even (one, of course).

Regards, Barend

_______________________________________________
Geometry mailing list
Geometry_at_[hidden]
http://lists.boost.org/mailman/listinfo.cgi/geometry

Geometry list run by mateusz at loskot.net