[MDEV-7510] GIS: IsRing returns false for a primitive triangle Created: 2015-01-27  Updated: 2015-03-13  Resolved: 2015-03-13

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

Type: Bug Priority: Critical
Reporter: Elena Stepanova Assignee: Alexey Botchkov
Resolution: Fixed Votes: 0
Labels: gis

Issue Links:
Relates
relates to MDEV-7509 Testing for GIS extensions Closed

 Description   

10.1 revision 0105bf349a...

MariaDB [test]> select ST_IsRing(ST_LineFromText('LINESTRING(0 0,0 10,10 10,0 0)'));
+--------------------------------------------------------------+
| ST_IsRing(ST_LineFromText('LINESTRING(0 0,0 10,10 10,0 0)')) |
+--------------------------------------------------------------+
|                                                            0 |
+--------------------------------------------------------------+

PostgeSQL 9.4, PostGIS 2.1.5

pgis=# select ST_IsRing(ST_LineFromText('LINESTRING(0 0,0 10,10 10,0 0)'));
 st_isring 
-----------
 t
(1 row)



 Comments   
Comment by Ian Gilfillan [ 2015-02-03 ]

IsRing is supposed to apply if IsSimple and IsClosed. In the above example, IsClosed is true, while IsSimple is false, when it seems it should be true.

select ST_IsSimple(ST_LineFromText('LINESTRING(0 0,0 10,10 10,0 0)'));
+----------------------------------------------------------------+
| ST_IsSimple(ST_LineFromText('LINESTRING(0 0,0 10,10 10,0 0)')) |
+----------------------------------------------------------------+
|                                                              0 |
+----------------------------------------------------------------+
 
select ST_IscLOSED(ST_LineFromText('LINESTRING(0 0,0 10,10 10,0 0)'));
+----------------------------------------------------------------+
| ST_IscLOSED(ST_LineFromText('LINESTRING(0 0,0 10,10 10,0 0)')) |
+----------------------------------------------------------------+
|                                                              1 |
+----------------------------------------------------------------+

Comment by Alexey Botchkov [ 2015-03-13 ]

Fixing patch: http://lists.askmonty.org/pipermail/commits/2015-March/007583.html

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