pingcap / tidb

TiDB is an open-source, cloud-native, distributed, MySQL-Compatible database for elastic scale and real-time analytics. Try AI-powered Chat2Query free at : https://www.pingcap.com/tidb-serverless/
https://pingcap.com
Apache License 2.0
37.01k stars 5.82k forks source link

Please help support distance calculations for geographic like ST_Distance in Mysql #18290

Open yilongrong opened 4 years ago

yilongrong commented 4 years ago

Feature Request

Is your feature request related to a problem? Please describe:

Please help support distance calculations for geographic like ST_Distance in mysql https://asktug.com/t/topic/35682

Describe the feature you'd like:

customer could use this fuction calcuate distance.

Describe alternatives you've considered:

please refer to mysql : https://dev.mysql.com/doc/refman/8.0/en/spatial-relation-functions-object-shapes.html#function_st-distance

Teachability, Documentation, Adoption, Migration Strategy:

https://asktug.com/t/topic/35682

zz-jason commented 4 years ago

A lot of spatial analysis functions are not supported by TiDB. In the following use case of ST_Distance:

mysql> SET @g1 = Point(1,1);
mysql> SET @g2 = Point(2,2);
mysql> SELECT ST_Distance(@g1, @g2);
+-----------------------+
| ST_Distance(@g1, @g2) |
+-----------------------+
|    1.4142135623730951 |
+-----------------------+

The unsupported functions are:

@yilongrong If we only support ST_Distance(), would it satisfy the requirement of applications?

yilongrong commented 4 years ago

Customer just need ST_Distance() now,if have more function would better.

zz-jason commented 4 years ago

@yilongrong I'm curious about how to represent a Point if we only ST_Distance() is supported. Could you explain more about the use cases with some examples?

MySQL supports Spatial Data Types, but we haven't. Seems we need to support this type firstly. Am I correct?

Triple-Z commented 2 years ago

Is there have any updates on this issue?

iAmBipinPaul commented 8 months ago

Waiting for this feature..

eaglexiang commented 2 months ago

any progress?