Bug #96759 Add ST_Quadkey(),ST_PointFromQuadkey(),ST_Lat/LongFromQuadkey() function
Submitted: 5 Sep 2019 2:39 Modified: 6 Sep 2019 6:40
Reporter: Yoshiaki Yamasaki Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: GIS Severity:S4 (Feature request)
Version:8.0 OS:Any
Assigned to: CPU Architecture:Any

[5 Sep 2019 2:39] Yoshiaki Yamasaki
Description:
Quadkey is a type of geocoding system. Quadkey has the following advantages and disadvantages over GeoHash.

 [Advantages]
   - The shape of the cord mesh is correctly square. Geodetic datum is WGS84.
     (Geohash: The shape of the cord mesh is rectangular.)
   - Easy to adjust accuracy. When it is one level below the code mesh, it is divided into 4.
     (Geohash: When it is one level below the code mesh, it is divided into 32.)
   - Easy acquisition logic for neighboring code mesh.
   - Easy distance calculation of code mesh area.

 [Disadvantages]
   - Longer code size(In the same accuracy, approximately 2.5 times)

I think "Longer code size" is not a big issue. Therefore, I want MySQL to implement a Spatial function that can handle not only GeoHash but also Quadkey.

Note1:
Tile Coordinates and Quadkeys
https://docs.microsoft.com/en-us/bingmaps/articles/bing-maps-tile-system#tile-coordinates-...

Note2:
This article is written in Japanese, but explains the differences between GeoHash and Quadkey. In addition, this article summarizes the search times for point data that are within a 10km radius regarding following 5 patterns.(This article poted on Jun 2015.)

 Spatial radius search with one-dimensional hash code
 https://qiita.com/kochizufan/items/2fe5f4c9f74636d22ddb

 5 patterns
  1. MBWithin() with MyISAM
  2. quadkey with MyISAM
  3. GeoHash with MyISAM
  4. quadkey with InnoDB
  5. GeoHash with InnoDB

How to repeat:
N/A

Suggested fix:
Add following Spatial functions.
 - ST_Quadkey()
 - ST_PointFromQuadkey()
 - ST_LatFromQuadkey()
 - ST_LongFromQuadkey()
[6 Sep 2019 6:40] MySQL Verification Team
Hello Yamasaki-San,

Thank you for the feature request!

regards,
Umesh