我在SO上读了几个关于这个主题的问题和答案,但我不明白哪种方法是常见的(如果有的话...)以找到以给定点为中心,半径为特定值的“圆”内的所有点。
特别是我找到了两种看起来最有说服力的方法:
select id, point
from my_table
where st_Distance(point, st_PointFromText('POINT(-116.768347 33.911404)', 4326)) < 10000;
并且:
select id, point
from my_table
where st_Within(point, st_Buffer(st_PointFromText('POINT(-116.768347 33.911404)', 4326), 10000));
什么是查询数据库的最有效方式?还有其他可考虑的选项吗?