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

            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.

            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.