Bug #43951 not correct result of the spatial function 'Contains()'
Submitted: 30 Mar 2009 7:20 Modified: 30 Mar 2009 8:42
Reporter: Stanislav Motycka Email Updates:
Status: Unsupported Impact on me:
None 
Category:MySQL Server: GIS Severity:S3 (Non-critical)
Version:5.1.32-0.dotdeb.1-log (Debian) OS:Linux (debian testing)
Assigned to: CPU Architecture:Any
Tags: contains, mbrcontains, spatial

[30 Mar 2009 7:20] Stanislav Motycka
Description:

Example:
# setting of the polygon
mysql> set @poly=geomfromtext('POLYGON((0 1,4 1,3 4, 0 1))');
# setting of the point, which is outside of the polygon '@poly' but in the extent (in the envelope()) of the polygon '@poly'
mysql> set @point=geomfromtext('POINT(1 3)');
mysql> select contains(@poly, @point);
+-------------------------+
| contains(@poly, @point) |
+-------------------------+
|                       1 | 
+-------------------------+
But, the right result should be '0'.

Bug:
The result of the function 'Contains()' is same as the result of the function MBRContains().

Similar:
 - Within() = MBRWithin()

How to repeat:
The result of the function 'Contains()' is same as the result of the function MBRContains()
[30 Mar 2009 8:42] Valeriy Kravchuk
Sorry, but this is an explicitely documented limitation of current GIS functions implementation in MySQL. Please, read http://dev.mysql.com/doc/refman/5.1/en/functions-that-test-spatial-relationships-between-g...:

"Currently, MySQL does not implement these functions according to the specification. Those that are implemented return the same result as the corresponding MBR-based functions. This includes functions in the following list other than Distance() and Related()."