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

GIS: PointOnSurface returns NULL instead of the point

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: N/A
    • Fix Version/s: 10.1.4
    • Component/s: GIS
    • Labels:

      Description

      10.1 tree
      MariaDB [test]> SELECT ST_AsText(ST_PointOnSurface(ST_PolyFromText('POLYGON((-70.916 42.1002,-70.9468 42.0946,-70.9754 42.0875,-70.9749 42.0879,-70.9759 42.0897,-70.916 42.1002))')));
      +-----------------------------------------------------------------------------------------------------------------------------------------------------------------+
      | ST_AsText(ST_PointOnSurface(ST_PolyFromText('POLYGON((-70.916 42.1002,-70.9468 42.0946,-70.9754 42.0875,-70.9749 42.0879,-70.9759 42.0897,-70.916 42.1002))'))) |
      +-----------------------------------------------------------------------------------------------------------------------------------------------------------------+
      | NULL                                                                                                                                                            |
      +-----------------------------------------------------------------------------------------------------------------------------------------------------------------+
      1 row in set (0.00 sec)
      
      PostGIS
      pgis=# SELECT ST_AsText(ST_PointOnSurface(ST_PolyFromText('POLYGON((-70.916 42.1002,-70.9468 42.0946,-70.9754 42.0875,-70.9749 42.0879,-70.9759 42.0897,-70.916 42.1002))')));
                   st_astext             
      -----------------------------------
       POINT(-70.9510231824279 42.09385)
      (1 row)
      

      The shape is rather simple (see the picture).

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

              Hide
              greenman Ian Gilfillan added a comment -

              The function doesn't seem to return a point under any circumstances. It even fails for a single point:

              SET @g = ST_GEOMFROMTEXT('Point(0 5)');
              
              SELECT ST_ASTEXT(ST_POINTONSURFACE(@g));
              +----------------------------------+
              | ST_ASTEXT(ST_POINTONSURFACE(@g)) |
              +----------------------------------+
              | NULL                             |
              +----------------------------------+
              
              Show
              greenman Ian Gilfillan added a comment - The function doesn't seem to return a point under any circumstances. It even fails for a single point: SET @g = ST_GEOMFROMTEXT('Point(0 5)'); SELECT ST_ASTEXT(ST_POINTONSURFACE(@g)); +----------------------------------+ | ST_ASTEXT(ST_POINTONSURFACE(@g)) | +----------------------------------+ | NULL | +----------------------------------+
              Show
              holyfoot Alexey Botchkov added a comment - Fixing patch: http://lists.askmonty.org/pipermail/commits/2015-March/007595.html

                People

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

                  Dates

                  • Created:
                    Updated:
                    Resolved:

                    Time Tracking

                    Estimated:
                    Original Estimate - Not Specified
                    Not Specified
                    Remaining:
                    Remaining Estimate - 0 minutes
                    0m
                    Logged:
                    Time Spent - 3 hours
                    3h