Bug #36224 Within-Function gives wrong results - Point is wrongly in Polygon
Submitted: 20 Apr 2008 19:59 Modified: 22 Apr 2008 21:32
Reporter: Monty Muth Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: GIS Severity:S3 (Non-critical)
Version:5.1.24-rc OS:Windows (XP SP2)
Assigned to: CPU Architecture:Any
Tags: gis

[20 Apr 2008 19:59] Monty Muth
Description:
The "Within" GIS-Function give me wrong results. It says that a point is within a polygon, but in realy its not. 

How to repeat:
See the attachment, for variables and a example picture.

...> insert attachment variables <...

select within(@poin,@poly_outer);
The Result is 1;

But it should be 0, the Point is not in the Polygon;

The Coordinate Reference System is EPSG:31469 (DHDN / Gauss-Kruger zone 5)

PostgreSQL/Postgis gives me the right result (0) with the same data (st_within   Function).
[20 Apr 2008 20:00] Monty Muth
Within-function says the point is inside the polygon

Attachment: within_bug.PNG (image/png, text), 15.90 KiB.

[20 Apr 2008 20:02] Monty Muth
Variables for Example

Attachment: within_bugtxt.txt (text/plain), 8.90 KiB.

[22 Apr 2008 20:44] Monty Muth
I found a hint at http://forge.mysql.com/wiki/GIS_Functions:
"Most notably is that all functions that query spatial data only operate on MBRs (minimum bounding rectangles), to simplify the operations.

Thanks to MySQL Developer Alexey "Holyfoot" Botchkov from Izhevsk, Russia, some of the spatial relation functions like INTERSECTS and WITHIN now work in the way they are described by OpenGIS and not by using MBR's as it used to be."

Has the 5.1.24-rc the new WITHIN Function from Holyfoot?
[22 Apr 2008 21:32] Monty Muth
It's not a bug, "fixed" in GIS Version 5.1.23-gis.