id,summary,reporter,owner,description,type,status,milestone,component,version,severity,resolution,keywords,cc 10835,difference of multilinestring and polygon yields wrong result,Philipp Müller ,Barend Gehrels,"I am using the following typedefs to simplify reading: {{{ typedef boost::geometry::model::point TPoint; typedef boost::geometry::model::linestring TLinestring; typedef boost::geometry::model::multi_linestring TMultiLinestring; typedef boost::geometry::model::polygon TPolygon; }}} I have a multilinestring from which I want to subtract two polygons. The multilinestring and polygons are as follows {{{ TMultiLinestring multilinestring; boost::geometry::read_wkt(""MULTILINESTRING((5239 2113,1020 2986))"", multilinestring); TPolygon polygon1; boost::geometry::read_wkt(""POLYGON((5233 2113,5200 2205,1020 2205,1020 2022,5200 2022))"", polygon1); TPolygon polygon2; boost::geometry::read_wkt(""POLYGON((5233 2986,5200 3078,1020 3078,1020 2895,5200 2895))"", polygon2); }}} First, I subtract polygon1 from multilinestring, which works fine: {{{ TMultiLinestring multilinestringOut1; boost::geometry::difference(multilinestring, polygon1, multilinestringOut1); // works as expected: multilinestringOut1 holds MULTILINESTRING((5239 2113,5233 2114)(4795 2205, 1020 2986)) }}} Now I want to subtract polygon2 from multilinestringOut1 (the intermediate result from the previous calculation), which yields a wrong result. {{{ TMultiLinestring multilinestringOut2; boost::geometry::difference(multilinestringOut1, polygon2, multilinestringOut2); // not as expected: multilinestringOut2 holds MULTILINESTRING((5239 2113,5233,2114)(4795 2205, 5406 1580)) }}} I would expect multilinestringOut2 to hold {{{ MULTILINESTRING((5239 2113,5233,2114)(4795 2205, 1460 2895)) }}} ",Bugs,closed,Boost 1.58.0,geometry,Boost 1.57.0,Regression,fixed,geometry difference multi_linestring polygon,mkaravel