Boost logo

Geometry :

Subject: [geometry] Problem using intersection algorithm with example code supplied
From: Lionel_1 (lionelcayla_at_[hidden])
Date: 2014-11-26 08:22:12


I would like to use Boost Geometry in my current library project. I would
need Union Intersection functionality among others.
While I could use successfully boost concepts directly I haven't been able
to use legacy structures. I have tried the example code from "Adapting a
legacy Object Model"

Whereas I could make it work when using a Point Collection as return
geometry, I got the following compilation errors when returning a Polygon

'push_back' : is not a member of 'QRing'


void main(void)
        QLineString line1;
        line1.points.push_back(&QPoint(4., 0.));
        line1.points.push_back(&QPoint(0., 4.));

        QLineString line2;
        line1.points.push_back(&QPoint(7., 0.));
        line1.points.push_back(&QPoint(0., 8.));

        QPolygon poly1;
        QRing ring1;
        poly1.exterior= &ring1;

        QPolygon poly2;
        QRing ring2;
        poly1.exterior = &ring2;

        std::vector<QPolygon> output;
        boost::geometry::intersection(poly1, poly2, output);

I have adapted the QRing class as described, and it seems either that I have
done something wrong (but I can't see what), or that there is something
missing. Has anyone a clue about it?

Thanks for taking the time to read me,


View this message in context:
Sent from the Boost Geometry mailing list archive at

Geometry list run by mateusz at