Bug #69538 | Spatial geometry function returns wrong result | ||
---|---|---|---|
Submitted: | 21 Jun 2013 8:17 | Modified: | 21 May 2015 14:39 |
Reporter: | Vaclav Novotny | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: GIS | Severity: | S2 (Serious) |
Version: | 5.6.12 x64, 5.6.21 | OS: | Windows (Win7 x64) |
Assigned to: | CPU Architecture: | Any | |
Tags: | Spatial functions, ST_Touches |
[21 Jun 2013 8:17]
Vaclav Novotny
[30 Jun 2013 9:40]
Vaclav Novotny
Workaround: increase size of poitn (make it a circle) in sufficient scale to maintain accuracy. Use mysql function BUFFER(g, d) for increasing and then test relationship with function ST_CROSSES. Example: SET @point = BUFFER(GEOMFROMTEXT('POINT(1 0)'), 0.0001); SET @poly = GEOMFROMTEXT('POLYGON((0 0,2 0,2 4,0 6,0 0))'); SELECT ST_CROSSES( @point, @poly);
[21 Jul 2014 19:06]
Sveta Smirnova
Thank you for the report. Verified as described. While we can discuss if definition of ST_TOUCHES ("Two geometries spatially touch if the interiors of the geometries do not intersect, but the boundary of one of the geometries intersects either the boundary or the interior of the other. ") means that only points 0 0, 2 0, 2 4 and 0 6 can touch, but it is certain that 100 0 cannot overlap the polygon.
[21 May 2015 14:39]
Paul DuBois
Noted in 5.7.8, 5.8.0 changelogs. ST_Within() and ST_Touches() could return incorrect results for some arguments.
[21 May 2015 14:43]
Paul DuBois
Issues were resolved by use of Boost.Geometry for GIS algorithms.