Boost logo

Geometry :

Subject: Re: [geometry] Interesection points
From: Barend Gehrels (barend_at_[hidden])
Date: 2013-08-13 12:22:18


Hi,

On 13-8-2013 9:25, Hunk wrote:
> Hello,
>
> i am trying to get one intersection point between line polygon or line line,
>
> i tried
>
> typedef model::d2::point_xy<double> point;
> typedef model::ring< point > ring;
> typedef model::polygon< point > polygon;
> typedef model::linestring< point > linestring;
> boost::geometry::read_wkt(
> "POLYGON((0 0,1 0, 1 1,0 1))", green);
> linestring ls;
> boost::geometry::read_wkt("LINESTRING(0.5 -1,0.5 0.5)", ls);
> std::vector<point> intersections;
> boost::geometry::intersection(green, blue, intersections);
>
> but it is not working. I only want the point which is on the border.
> Anyone has an idea for that ?
>
> thank you for help. I am really new on boost.

It should work. See for example the function void test_point_output() in
intersection.cpp in the test-code (libs/geometry/test/algorithms). But
your program will never compile. Where is green/blue declared? What aree
you doing with ls?

What is not working? Not compiling?

Regards, Barend


Geometry list run by mateusz at loskot.net