#include namespace bg = boost::geometry; typedef bg::model::point point_type; typedef bg::model::polygon polygon_type;//ccw, open typedef bg::model::multi_polygon multi_polygon_type; typedef bg::model::box box_type; typedef multi_polygon_type _intPolygon; typedef box_type _intRect; int main() { // RT#8837 _intPolygon polygonA; boost::geometry::read_wkt("MULTIPOLYGON(((488 2035,527 2035,527 2093,488 2093)))", polygonA); // does not throw _intRect rectB; boost::geometry::read_wkt("BOX(417 2064,597 2064)", rectB); // does not throw _intPolygon polygonC; boost::geometry::difference(polygonA, rectB, polygonC); // ACCESS VIOLATION std::cout << bg::wkt(polygonA) << std::endl; std::cout << bg::wkt(rectB) << std::endl; std::cout << bg::wkt(polygonC) << std::endl; return 0; }