Boost logo

Geometry :

Subject: Re: [geometry] Intersection of linestring with polygon
From: Barend Gehrels (barend_at_[hidden])
Date: 2012-02-07 13:49:44


Hi Sebastian,

In addition to the answer of Edd.

On 7-2-2012 9:27, Sebastian wrote:
> Barend wrote
>> It is now basically running for most linear/aereal combinations
>> ((multi)linestring/(multi)polygon/ring). Almost all cases are running.
>> Almost, because there is at least one case not yet finished and there
>> might be more. But those are the more exotic ones, you will probably
>> (depending on your usecase of course) have no problems. In case you are
>> trying it already and encounter a problem, please report it.
>>
> Is there any progress on that matter?

What was implemented (november) is the intersection of
polygon/linestring. So that outputs zero or more linestrings. That will
be in 1.49.

> I've tried an intersection test with a
> line string and a polygon/ring but it didn't work. I got a compiler error.
> Here's my source code:
>
> http://boost.codepad.org/rVahJTRJ http://boost.codepad.org/rVahJTRJ

Your request is much simpler: you want to have true/false.

Indeed intersects does not support that, so please refer to the sample
that Edd gave (it is also in trunk/release in the example folder).

Alternatively you could call intersection and use num_points (or
empty()) to check if there is any output.

The inclusion in intersects should be possible for next round (= 1.50).

Regards, Barend


Geometry list run by mateusz at loskot.net