Fastest Way to Find Distance Between Two Lat/Long Points

后端 未结 15 960
时光说笑
时光说笑 2020-11-21 10:12

I currently have just under a million locations in a mysql database all with longitude and latitude information.

I am trying to find the distance between one point a

15条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-11-21 10:32

    if you are using MySQL 5.7.*, then you can use st_distance_sphere(POINT, POINT).

    Select st_distance_sphere(POINT(-2.997065, 53.404146 ), POINT(58.615349, 23.56676 ))/1000  as distcance
    

提交回复
热议问题