Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-7510

GIS: IsRing returns false for a primitive triangle

Details

    • Bug
    • Status: Closed (View Workflow)
    • Critical
    • Resolution: Fixed
    • 10.1(EOL)
    • 10.1.4
    • GIS

    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)

      Attachments

        Issue Links

          Activity

            elenst Elena Stepanova created issue -
            elenst Elena Stepanova made changes -
            Field Original Value New Value
            elenst Elena Stepanova made changes -
            Summary GIS: IsRing returns false for a primitive line GIS: IsRing returns false for a primitive triangle
            greenman Ian Gilfillan added a comment -

            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 |
            +----------------------------------------------------------------+

            greenman Ian Gilfillan added a comment - 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 | +----------------------------------------------------------------+
            holyfoot Alexey Botchkov made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            holyfoot Alexey Botchkov added a comment - Fixing patch: http://lists.askmonty.org/pipermail/commits/2015-March/007583.html
            holyfoot Alexey Botchkov made changes -
            Fix Version/s 10.1.4 [ 18400 ]
            Fix Version/s 10.1 [ 16100 ]
            Resolution Fixed [ 1 ]
            Status In Progress [ 3 ] Closed [ 6 ]
            ratzpo Rasmus Johansson (Inactive) made changes -
            Workflow MariaDB v2 [ 59339 ] MariaDB v3 [ 64905 ]
            serg Sergei Golubchik made changes -
            Workflow MariaDB v3 [ 64905 ] MariaDB v4 [ 148748 ]

            People

              holyfoot Alexey Botchkov
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.