[MDEV-7925] Inconsistent behavior of ST_Touches with a POINT as one of arguments Created: 2015-04-06  Updated: 2015-06-23  Resolved: 2015-06-23

Status: Closed
Project: MariaDB Server
Component/s: GIS
Affects Version/s: 10.1
Fix Version/s: 10.1.6

Type: Bug Priority: Major
Reporter: Elena Stepanova Assignee: Alexey Botchkov
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Relates
relates to MDEV-7509 Testing for GIS extensions Closed
relates to MDEV-7069 Fix buildbot failures in main server ... Stalled
Sprint: 10.1.6-1

 Description   

Polygon and point, line and point

ST_Touches(POLYGON,POINT) and ST_Touches(LINESTRING,POINT) in some cases return true in 10.0 and PostgreSQL and false in 10.1:

10.1

MariaDB [test]> select ST_Touches(ST_LineFromText('LINESTRING(0 0,5 5)'),ST_PointFromText('POINT(0 0)'));
+-----------------------------------------------------------------------------------+
| ST_Touches(ST_LineFromText('LINESTRING(0 0,5 5)'),ST_PointFromText('POINT(0 0)')) |
+-----------------------------------------------------------------------------------+
|                                                                                 0 |
+-----------------------------------------------------------------------------------+
1 row in set (0.00 sec)
 
MariaDB [test]> select ST_Touches(ST_PolygonFromText('POLYGON((0 0,0 5,5 5,5 0,0 0))'),ST_PointFromText('POINT(0 0)'));
+-------------------------------------------------------------------------------------------------+
| ST_Touches(ST_PolygonFromText('POLYGON((0 0,0 5,5 5,5 0,0 0))'),ST_PointFromText('POINT(0 0)')) |
+-------------------------------------------------------------------------------------------------+
|                                                                                               0 |
+-------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

10.0

MariaDB [test]> select ST_Touches(ST_LineFromText('LINESTRING(0 0,5 5)'),ST_PointFromText('POINT(0 0)'));
+-----------------------------------------------------------------------------------+
| ST_Touches(ST_LineFromText('LINESTRING(0 0,5 5)'),ST_PointFromText('POINT(0 0)')) |
+-----------------------------------------------------------------------------------+
|                                                                                 1 |
+-----------------------------------------------------------------------------------+
1 row in set (0.00 sec)
 
MariaDB [test]> select ST_Touches(ST_PolygonFromText('POLYGON((0 0,0 5,5 5,5 0,0 0))'),ST_PointFromText('POINT(0 0)'));
+-------------------------------------------------------------------------------------------------+
| ST_Touches(ST_PolygonFromText('POLYGON((0 0,0 5,5 5,5 0,0 0))'),ST_PointFromText('POINT(0 0)')) |
+-------------------------------------------------------------------------------------------------+
|                                                                                               1 |
+-------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

PostgreSQL

pgis=# select ST_Touches(ST_LineFromText('LINESTRING(0 0,5 5)'),ST_PointFromText('POINT(0 0)'));
 st_touches 
------------
 t
(1 row)
 
pgis=# select ST_Touches(ST_PolygonFromText('POLYGON((0 0,0 5,5 5,5 0,0 0))'),ST_PointFromText('POINT(0 0)'));
 st_touches 
------------
 t
(1 row)

Two identical points

ST_Touches(POINT,POINT) returns true in 10.0 and false in 10.1.
In PostgreSQL, it also returns false. I'm not sure which is correct, the definition of ST_Touches leaves it unclear for a degenerate object such as point.

10.0

MariaDB [test]> select ST_Touches(ST_PointFromText('POINT(0 0)'),ST_PointFromText('POINT(0 0)'));
+---------------------------------------------------------------------------+
| ST_Touches(ST_PointFromText('POINT(0 0)'),ST_PointFromText('POINT(0 0)')) |
+---------------------------------------------------------------------------+
|                                                                         1 |
+---------------------------------------------------------------------------+
1 row in set (0.00 sec)

10.1

MariaDB [test]> select ST_Touches(ST_PointFromText('POINT(0 0)'),ST_PointFromText('POINT(0 0)'));
+---------------------------------------------------------------------------+
| ST_Touches(ST_PointFromText('POINT(0 0)'),ST_PointFromText('POINT(0 0)')) |
+---------------------------------------------------------------------------+
|                                                                         0 |
+---------------------------------------------------------------------------+
1 row in set (0.00 sec)

PostgreSQL

pgis=# select ST_Touches(ST_PointFromText('POINT(0 0)'),ST_PointFromText('POINT(0 0)'));
 st_touches 
------------
 f
(1 row)



 Comments   
Comment by Alexey Botchkov [ 2015-06-23 ]

http://lists.askmonty.org/pipermail/commits/2015-June/008077.html

Generated at Thu Feb 08 07:23:19 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.