geometry icon indicating copy to clipboard operation
geometry copied to clipboard

Invalid result of intersection for MLs, MPo -> MLs

Open awulkiew opened this issue 5 years ago • 0 comments

Geometry develop (1.72.0), with VS2017 x64.

image

typedef bg::model::point<double, 2, bg::cs::cartesian> point;
typedef bg::model::linestring<point> linestring;
typedef bg::model::polygon<point> polygon;
typedef bg::model::multi_linestring<linestring> multi_linestring;
typedef bg::model::multi_polygon<polygon> multi_polygon;

multi_polygon mpo{ { { {0, 0}, {0, 1}, {1, 1}, {1, 0}, {0, 0} },
                     { {0, 0}, {0.2, 0.1}, {0.1, 0.2}, {0, 0}  } } };
multi_linestring mls{ { {0, 0}, {1, 0}, {1, 1}, {2, 0}, {3, 0} },
                      { {-1, -1}, {0, 0}, {0, -1} } };
multi_linestring res_mls;

bg::intersection(mls, mpo, res_mls);

Result is: MULTILINESTRING((0 0, 1 0, 1 1), (1.249e-16 2.498e-16, 0 0, 0 -1)) should be: MULTILINESTRING((0 0, 1 0, 1 1))

awulkiew avatar Jan 07 '20 22:01 awulkiew