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

taking SRID into account in GIS fields and items.

Details

    • Task
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • None
    • GIS
    • None
    • 10.2.0-2

    Description

      For the 'spatial' classes defined in item_geofunc.h in their functions check the data's reference system (SRID)
      and call the proper library - planar or spherical calculation with respective parameters.

      Attachments

        Issue Links

          Activity

            holyfoot Alexey Botchkov created issue -
            holyfoot Alexey Botchkov made changes -
            Field Original Value New Value
            Fix Version/s 10.1 [ 16100 ]
            holyfoot Alexey Botchkov made changes -
            Description For the 'spatial' classes defined in item_geofunc.h in their functions check the data's reference system (SRID)
            and call the proper library - planar or spherical calculation with respective parameters.
            psergei Sergei Petrunia made changes -
            ratzpo Rasmus Johansson (Inactive) made changes -
            Parent MDEV-7540 [ 49900 ]
            Issue Type Technical task [ 7 ] Task [ 3 ]
            ratzpo Rasmus Johansson (Inactive) made changes -
            serg Sergei Golubchik made changes -
            ratzpo Rasmus Johansson (Inactive) made changes -
            Sprint 10.2.0-2 [ 26 ]
            ratzpo Rasmus Johansson (Inactive) made changes -
            Rank Ranked lower
            ratzpo Rasmus Johansson (Inactive) made changes -
            Rank Ranked higher
            serg Sergei Golubchik made changes -
            Fix Version/s 10.1 [ 16100 ]
            serg Sergei Golubchik made changes -
            Workflow MariaDB v3 [ 72105 ] MariaDB v4 [ 130385 ]
            alice Alice Sherepa added a comment - - edited

            currently if we have different SRID, there is no error or warning - just some calculations, even if they are wrong then:

            MariaDB [test]> SELECT ST_DISTANCE(ST_GEOMFROMTEXT('POINT(0 0)', 4326), ST_GEOMFROMTEXT('POINT(0 1)',3857));
            +--------------------------------------------------------------------------------------+
            | ST_DISTANCE(ST_GEOMFROMTEXT('POINT(0 0)', 4326), ST_GEOMFROMTEXT('POINT(0 1)',3857)) |
            +--------------------------------------------------------------------------------------+
            |                                                                                    1 |
            +--------------------------------------------------------------------------------------+
            1 row in set (0,001 sec)
             
            MariaDB [test]> SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)', 4326), ST_GEOMFROMTEXT('POINT(0 1)',3857));
            +---------------------------------------------------------------------------------------------+
            | ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)', 4326), ST_GEOMFROMTEXT('POINT(0 1)',3857)) |
            +---------------------------------------------------------------------------------------------+
            |                                                                          111194.68229846345 |
            +---------------------------------------------------------------------------------------------+
            1 row in set (0,002 sec)
            

            mysql (8.0.35) returns error :

            mysql> SELECT ST_DISTANCE(ST_GEOMFROMTEXT('POINT(0 0)', 4326), ST_GEOMFROMTEXT('POINT(0 1)',3857));
            ERROR 3033 (HY000): Binary geometry function st_distance given two geometries of different srids: 4326 and 3857, which should have been identical.
             
            mysql>  SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)', 4326), ST_GEOMFROMTEXT('POINT(0 1)',3857));
            ERROR 3033 (HY000): Binary geometry function st_distance_sphere given two geometries of different srids: 4326 and 3857, which should have been identical.
            

            alice Alice Sherepa added a comment - - edited currently if we have different SRID, there is no error or warning - just some calculations, even if they are wrong then: MariaDB [test]> SELECT ST_DISTANCE(ST_GEOMFROMTEXT('POINT(0 0)', 4326), ST_GEOMFROMTEXT('POINT(0 1)',3857)); +--------------------------------------------------------------------------------------+ | ST_DISTANCE(ST_GEOMFROMTEXT('POINT(0 0)', 4326), ST_GEOMFROMTEXT('POINT(0 1)',3857)) | +--------------------------------------------------------------------------------------+ | 1 | +--------------------------------------------------------------------------------------+ 1 row in set (0,001 sec)   MariaDB [test]> SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)', 4326), ST_GEOMFROMTEXT('POINT(0 1)',3857)); +---------------------------------------------------------------------------------------------+ | ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)', 4326), ST_GEOMFROMTEXT('POINT(0 1)',3857)) | +---------------------------------------------------------------------------------------------+ | 111194.68229846345 | +---------------------------------------------------------------------------------------------+ 1 row in set (0,002 sec) mysql (8.0.35) returns error : mysql> SELECT ST_DISTANCE(ST_GEOMFROMTEXT('POINT(0 0)', 4326), ST_GEOMFROMTEXT('POINT(0 1)',3857)); ERROR 3033 (HY000): Binary geometry function st_distance given two geometries of different srids: 4326 and 3857, which should have been identical.   mysql> SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)', 4326), ST_GEOMFROMTEXT('POINT(0 1)',3857)); ERROR 3033 (HY000): Binary geometry function st_distance_sphere given two geometries of different srids: 4326 and 3857, which should have been identical.
            alice Alice Sherepa made changes -
            alice Alice Sherepa made changes -
            Assignee Alexey Botchkov [ holyfoot ] Dave Gosselin [ JIRAUSER52216 ]

            People

              Gosselin Dave Gosselin
              holyfoot Alexey Botchkov
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

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