Opened 6 months ago

## #13494 new Bugs

# polygon intersection fails

Reported by: | Owned by: | Barend Gehrels | |
---|---|---|---|

Milestone: | To Be Determined | Component: | geometry |

Version: | Boost 1.66.0 | Severity: | Showstopper |

Keywords: | geometry intersection | Cc: |

### Description

Hello,

executing the following polygon intersection produces an empty result although the second operand is completely inside the first.

Code snippet:

using point_type = boost::geometry::model::d2::point_xy<double>; using polygon = boost::geometry::model::polygon<point_type>; using multi_polygon = boost::geometry::model::multi_polygon<polygon>;

polygon op1, op2; multi_polygon result;

boost::geometry::read_wkt("POLYGON((-1.99900000000000011 -0.889961757413527343,-1.99900000000000011 -1.12178395051169733,-1.89792526415373097 -1.49900000000000011,-1.8358086947169705 -1.49900000000000011,-1.99900000000000011 -0.889961757413527343))", op1); boost::geometry::read_wkt("POLYGON((-1.97591538973459313 -1.20793688888334905,-1.92415157993614439 -1.40112205701807624,-1.8661960316547388 -1.38559291465704759,-1.91795984145318754 -1.19240774652231996,-1.97591538973459313 -1.20793688888334905))", op2); boost::geometry::intersection(op1, op2, result);

I could track down the problem to the intersection/touch part. We use the intersection code quite heavily and such a constellation can occur frequently in our application. (I could present several more sample data for this bug). Therefore I set this to showstopper. Also I found other entries which look quite similar.

**Note:**See TracTickets for help on using tickets.