Bug #69425 St_Intersection produces incorrect results
Submitted: 7 Jun 2013 12:43 Modified: 21 May 2015 14:34
Reporter: Ivan Balashov Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: GIS Severity:S2 (Serious)
Version:5.6.11, 5.6.21 OS:FreeBSD (from ports)
Assigned to: CPU Architecture:Any
Tags: 5.6, spatial, St_Intersection

[7 Jun 2013 12:43] Ivan Balashov
Description:
St_Intersection produces incorrect results while calling several times on multipolygon with holes and polygon intersection.

St_Intersection makes as result an multipolygon with incorrect holes.

St_Intersection makes different intersection results on multiply calls.

Single call gives right result.

To detect this bug you may calculate Area(St_Intersection) or view on resulting geometry in geometry viewers. Area fluctuation in how-to-repeat query is shown.

How to repeat:
Execute queries from attached file.
See at ST_AREA column values - it varies from 0.005072965010581285 to 0.0076609711081375015
[7 Jun 2013 12:43] Ivan Balashov
test queries

Attachment: St_Intersection_bug.sql (text\plain, text), 36.84 KiB.

[21 Jul 2014 19:30] Sveta Smirnova
Thank you for the report.

Verified as described.
[21 May 2015 14:34] Paul DuBois
Noted in 5.7.8, 5.8.0 changelogs.

Multiple calls to ST_Intersection() could return inconsistent results
for some arguments.
[21 May 2015 14:44] Paul DuBois
Issues were resolved by use of Boost.Geometry for GIS algorithms.