#11984 closed Bugs (fixed)

union_() generates self-intersecting polygon

Reported by: max@… Owned by: barendgehrels
Milestone: Boost 1.61.0 Component: geometry
Version: Boost 1.60.0 Severity: Problem
Keywords: Cc:


I have a program which generates unions of a multipolygon and a ring. Sometimes, I have an identical point in the two shapes. The union_ result is a self-intersecting polygon.

Demo source attached. Output with Boost 1.58 and 1.60:

input multipolygon is valid input ring is valid result multipolygon is invalid: Geometry has invalid self-intersections. A self-intersection point was found at (-95, 60); method: t; operations: i/i; segment IDs {source, multi, ring, segment}: {0, 0, -1, 3}/{0, 0, -1, 6}

Attachments (1)

union_bug.cxx (2.6 KB) - added by max@… 16 months ago.
Demo source for the union_ bug

Download all attachments as: .zip

Change History (3)

Changed 16 months ago by max@…

Demo source for the union_ bug

comment:1 Changed 16 months ago by anonymous

I think the problem is not union_() - the correct result is a polygon that "touches" itself (but does not actually intersect), and that's what union_() does. The problem may just be a false negative in is_valid().

comment:2 Changed 15 months ago by barendgehrels

  • Milestone changed from To Be Determined to Boost 1.61.0
  • Resolution set to fixed
  • Status changed from new to closed

Thanks for the report. It is fixed in the branch feature/cluster_touch

  • still hope to get it in 1.61 because it fixes more issues

Add Comment

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain barendgehrels.
The resolution will be deleted. Next status will be 'reopened'.

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.