Boost logo

Geometry :

Subject: [ggl] Intersection of linestring with polygon
From: Barend Gehrels (barend)
Date: 2011-11-17 00:50:40


Hi Mike, Aleksander,

On 15-11-2011 8:23, Aleksandar Babic wrote:
> Hi,
>
> It seems that the functionality for few combinations (also for some
> other algorithms) is not yet implemented.
>
> One approximation that you might try (may be valid approach from case to
> case) is to try converting both geometries to the closest common
> concept.
> For example, try converting line and polygon to the linestring/ring and
> the finding the intersection (might help with other algorithms as well).
>
> Hope this helps.
>
> BR
> Aleksandar
>
> On Mon, 2011-11-14 at 16:23 -0700, Mike Williams wrote:
>> Hello,
>>
>>
>>
>> I have successfully used boost::geometry::intersection to get the
>> intersection of two polygons. How I want to get the intersection of a
>> polygon and a line (the portion of the line that is internal to the
>> polygon). When I call intersection(polygon, linestring,
>> vector_of_linestring) I get compiler errors.
>>
>>
>>
>> Could someone please advise me on how that can be accomplished.
>>
>>

Indeed it is not yet implemented. It can be done (is done by some
people) by using intersection points, but that is a bit tedious (if
you're not deep inside the details of the library). Because this (plus
boolean functions) is asked so much I'll try to work on this coming weekend.

Aleksandar, to be honest I don't understand your suggestion completely,
or it might work for some algorithms but I don't see how it would work here.

Regards, Barend


Geometry list run by mateusz at loskot.net