Boost logo

Geometry :

Subject: [ggl] Re: Help needed with Intersection operation
From: angusj (awj1958)
Date: 2011-08-19 18:18:20

Christoph, on rereading your post I can see that my previous reply wont be
helpful as evidently you did 'close' the polygons (and the link I gave was
to the wrong thread too).

Anyhow, I have compiled and tested your polygons and can confirm that there
appears to be a small problem with the solution to an intersection operation
(which returns a single point well beyond any potential intersection).

  #include <boost/geometry.hpp>
  #include <boost/geometry/geometries/point_xy.hpp>
  #include <boost/geometry/geometries/polygon.hpp>
  #include <boost/geometry/multi/geometries/multi_polygon.hpp>
  #include <boost/geometry/domains/gis/io/wkt/wkt.hpp>

  typedef boost::geometry::model::polygon ggl_polygon;
  typedef boost::geometry::model::multi_polygon ggl_polygons;

        ggl_polygon blue, green;
        "POLYGON((0.24806946917841693 26.015444246572663, 31.751930530821582
33.984555753427337, "
                "32.248069469178418 30.015444246572663, 0.24806946917841693
26.015444246572663))", green);
        "POLYGON((17.763942722600319 32.236057277399681, 19.192448808558737
30.807551191441263, "
                "16.000000000000000 30.000000000000000, 17.763942722600319
32.236057277399681))", blue);
        ggl_polygons output;
        bg::intersection(green, blue, output);
        cout << output;

View this message in context:
Sent from the Boost Geometry mailing list archive at
-------------- next part --------------
An HTML attachment was scrubbed...

Geometry list run by mateusz at