Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我已经存储了用户 - 包括他们的地址 - 并且需要找到居住在特定位置一定距离内的所有用户。
我正在使用geocoder并将经度和纬度存储在用户表中。
geocoder
我如何找到这些用户?
要进行基于纬度/经度的查询,请执行以下操作:
User.near([39.41, 90.23], 10)
这将在纬度/经度对 10 英里范围内找到用户。
以下是文档:https ://github.com/alexreisner/geocoder