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

Implement the GIS function ST_GeoHash

Details

    Description

      The GIS function ST_GeoHash takes as input:

      • (longitude, latitude, max_length), OR
      • (point, max_length)

      The longitue parameter is a numeric value in the interval [180, -180], the latitude is a numeric value in the interval [90, -90].
      In the case of point, the x coordinate is treated as the latitude and the y coordinate is treated as the latitude. Even in the case of a point, the same constraints apply.
      The max_length parameter is the upper limit on the resulting string size and cannot exceed 100.

      The function returns the geohash corresponding to the input values.

      Attachments

        Issue Links

          Activity

            Stefano Petrilli Stefano Petrilli created issue -
            Stefano Petrilli Stefano Petrilli made changes -
            Field Original Value New Value
            Stefano Petrilli Stefano Petrilli made changes -
            Stefano Petrilli Stefano Petrilli made changes -
            Stefano Petrilli Stefano Petrilli made changes -
            serg Sergei Golubchik made changes -
            Assignee Dave Gosselin [ JIRAUSER52216 ]
            Gosselin Dave Gosselin made changes -
            Fix Version/s 11.7 [ 29815 ]
            Gosselin Dave Gosselin made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            Gosselin Dave Gosselin made changes -
            Assignee Dave Gosselin [ JIRAUSER52216 ] Alexey Botchkov [ holyfoot ]
            Status In Progress [ 3 ] In Review [ 10002 ]
            Gosselin Dave Gosselin made changes -
            Status In Review [ 10002 ] In Testing [ 10301 ]
            Gosselin Dave Gosselin made changes -
            Assignee Alexey Botchkov [ holyfoot ] Dave Gosselin [ JIRAUSER52216 ]
            serg Sergei Golubchik made changes -
            ralf.gebhardt Ralf Gebhardt made changes -
            Labels Compatibility GIS gsoc24 Compatibility GIS Preview_11.7 gsoc24
            alice Alice Sherepa added a comment -

            wrong error message- GIS is not invalid here:

            MariaDB [test]> SELECT  ST_GeoHash(( POINTFROMTEXT(' POINT( 4 1 ) ') ), 1e0) ;
            ERROR 3037 (22023): Invalid GIS data provided to function ST_GeoHash.
            

            maybe make a better error message - write smth like : max_length parameter should be in from 1 to 100 :

            MariaDB [test]> SELECT  ST_GeoHash(( POINTFROMTEXT(' POINT( 4 1 ) ') ), 0) ;
            ERROR 3048 (HY000): Out of range error: max geohash length value in function ST_GeoHash.
            

            alice Alice Sherepa added a comment - wrong error message- GIS is not invalid here: MariaDB [test]> SELECT ST_GeoHash(( POINTFROMTEXT(' POINT( 4 1 ) ') ), 1e0) ; ERROR 3037 (22023): Invalid GIS data provided to function ST_GeoHash. maybe make a better error message - write smth like : max_length parameter should be in from 1 to 100 : MariaDB [test]> SELECT ST_GeoHash(( POINTFROMTEXT(' POINT( 4 1 ) ') ), 0) ; ERROR 3048 (HY000): Out of range error: max geohash length value in function ST_GeoHash.
            ralf.gebhardt Ralf Gebhardt made changes -
            Fix Version/s 11.8 [ 29921 ]
            Fix Version/s 11.7 [ 29815 ]
            Assignee Dave Gosselin [ JIRAUSER52216 ] Alice Sherepa [ alice ]
            serg Sergei Golubchik made changes -
            ralf.gebhardt Ralf Gebhardt made changes -
            Labels Compatibility GIS Preview_11.7 gsoc24 Compatibility GIS Preview_11.7 Preview_11.8 gsoc24
            alice Alice Sherepa added a comment -

            NULL is expected:

            MariaDB [test]> SELECT ST_GeoHash(45,-20,null);
            +-------------------------+
            | ST_GeoHash(45,-20,null) |
            +-------------------------+
            | mh2n0p0581b0bh2n0p0581g |
            +-------------------------+
            1 row in set (0,001 sec)
             
            MariaDB [test]> SELECT ST_GeoHash(0,-20,null);
            +------------------------------------------------------------------------------------------------------+
            | ST_GeoHash(0,-20,null)                                                                               |
            +------------------------------------------------------------------------------------------------------+
            | kh2n0p0581b0bh2n0p0581bpbpbpbpbpbpbpbpbpbpbpbpbpbpbpbpbpbpbpbpbpbpbpbpbpbpbpbpbpbpbpbpbpbpbpbpbpbpbp |
            +------------------------------------------------------------------------------------------------------+
            1 row in set (0,000 sec)
            

            alice Alice Sherepa added a comment - NULL is expected: MariaDB [test]> SELECT ST_GeoHash(45,-20,null); +-------------------------+ | ST_GeoHash(45,-20,null) | +-------------------------+ | mh2n0p0581b0bh2n0p0581g | +-------------------------+ 1 row in set (0,001 sec)   MariaDB [test]> SELECT ST_GeoHash(0,-20,null); +------------------------------------------------------------------------------------------------------+ | ST_GeoHash(0,-20,null) | +------------------------------------------------------------------------------------------------------+ | kh2n0p0581b0bh2n0p0581bpbpbpbpbpbpbpbpbpbpbpbpbpbpbpbpbpbpbpbpbpbpbpbpbpbpbpbpbpbpbpbpbpbpbpbpbpbpbp | +------------------------------------------------------------------------------------------------------+ 1 row in set (0,000 sec)
            alice Alice Sherepa made changes -
            Assignee Alice Sherepa [ alice ] Dave Gosselin [ JIRAUSER52216 ]
            alice Alice Sherepa made changes -
            Status In Testing [ 10301 ] Stalled [ 10000 ]
            serg Sergei Golubchik made changes -
            Fix Version/s 12.0 [ 29945 ]
            Fix Version/s 11.8 [ 29921 ]
            Gosselin Dave Gosselin made changes -
            Status Stalled [ 10000 ] In Progress [ 3 ]
            Gosselin Dave Gosselin made changes -
            Assignee Dave Gosselin [ JIRAUSER52216 ] Daniel Black [ danblack ]
            Status In Progress [ 3 ] In Review [ 10002 ]
            danblack Daniel Black added a comment -

            reviewed/merged lasted improvement. Thanks Dave.

            danblack Daniel Black added a comment - reviewed/merged lasted improvement. Thanks Dave.
            danblack Daniel Black made changes -
            Assignee Daniel Black [ danblack ] Dave Gosselin [ JIRAUSER52216 ]
            Status In Review [ 10002 ] Stalled [ 10000 ]
            Gosselin Dave Gosselin added a comment -

            julien.fritsch this is not critical fro 12.0 and will go into whatever release is pending at the point that testing is complete. So no need to rush a review or anything like that.

            Gosselin Dave Gosselin added a comment - julien.fritsch this is not critical fro 12.0 and will go into whatever release is pending at the point that testing is complete. So no need to rush a review or anything like that.
            Gosselin Dave Gosselin made changes -
            Fix Version/s 12.0.2 [ 30117 ]
            Fix Version/s 12.0 [ 29945 ]
            Resolution Fixed [ 1 ]
            Status Stalled [ 10000 ] Closed [ 6 ]
            Gosselin Dave Gosselin made changes -
            Fix Version/s 12.1 [ 29992 ]
            Fix Version/s 12.0.2 [ 30117 ]

            People

              Gosselin Dave Gosselin
              Stefano Petrilli Stefano Petrilli
              Votes:
              0 Vote for this issue
              Watchers:
              7 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.