Order by nearest - PostGIS, GeoRuby, spatial_adapter

后端 未结 6 2032
醉酒成梦
醉酒成梦 2021-02-06 04:03

I\'m trying to do an order query that finds records nearest to the current_user.

I know the distance between the two points is: current_location.euclidean_distance

6条回答
  •  不知归路
    2021-02-06 04:32

    If you dont NEED to use PostGIS, geo-kit does this perfectly using google or yahoo (I've only used Google) and in your queries you can sort by distance, its awesome..

提交回复
热议问题