Boost logo

Geometry :

Subject: Re: [geometry] Intersection of linestring with polygon
From: Barend Gehrels (barend_at_[hidden])
Date: 2013-10-16 10:40:48

Hi Suresh,

jakka30 wrote On 16-10-2013 15:23:
> Hi Adam & Barend,
> Thank you a lot for your quick reply. I changed "current_piece.size()" to
> boost::size(linestring) in two places at line number 399 & 185 in
> follow.hpp. Now I am getting an error at the line number 189
> (current_piece.clear()). The error message is
> *Error 1 error C2882: 'clear' : illegal use of namespace identifier in
> expression t:\boost\boost\geometry\algorithms\detail\overlay\follow.hpp 189*
> To just try to compile it, I commented line number 189 and then compiled it.
> I got the following error.
> *Error 1 error C2676: binary '[' : 'const MyLineString2D<Type>' does not
> define this operator or a conversion to a type acceptable to the predefined
> operator t:\boost\boost\geometry\algorithms\detail\overlay\follow.hpp 64*
> Could you please help me to fix this issue? I am trying to use the
> intersection operation between a custom polygon and custom linestring.
That is useful. Thanks for the report.

So .size() should indeed be boost::size(current_piece), and .clear()
should be replaced by traits::clear<LineStringOut>::apply(current_piece);

Then on line 64, linestring[op.seg_id.segment_index] should be replaced
by *(boost::begin(linestring) + op.seg_id.segment_index)

Sorry for these omissions, I apparently did not pay enough attention to

Regards, Barend

Geometry list run by mateusz at