如何获取附近的 POI

发布于 2024-08-29 15:51:48 字数 415 浏览 2 评论 0 原文

我有一个包含兴趣点的数据库,所有兴趣点都有一个地址。

我想知道从给定位置获取所有附近 POI 的方法/名称/调用是什么。

我知道我至少需要将所有地址转换为 LAT / LON 坐标,但我的问题是:

对于给定的 LAT / LONG,我如何从数据库/数组中获取距离附近的 POI,例如:

您是这里 0,0 2 公里半径内最近的兴趣点有:

  • POI A(1.1 公里处)
  • POI C(1.3 公里处)
  • POI F(1.9 公里处)

我不知道应该查看什么才能得到我想要的东西:-(

非常感谢任何帮助。 谢谢

I have a database with Points of Interest that all have an address.

I want to know what is the method/name/call to get all nearby POIs from a given position.

I understand that I need to convert all my addresses to LAT / LON coordinates at least, but my question is:

for a given LAT / LONG how do I get from the database/array what POIs are nearby by distance, for example:

You are here 0,0
nearest POIs in a 2km radius are:

  • POI A (at 1.1 Km)
  • POI C (at 1.3 Km)
  • POI F (at 1.9 Km)

I have no idea what should I look into to get what I want :-(

Any help is greatly appreciated.
Thank you

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

下壹個目標 2024-09-05 15:51:48

我想知道从给定位置获取所有附近 POI 的方法/名称/调用是什么。

使用 大圆距离 href="http://en.wikipedia.org/wiki/Haversine_formula" rel="nofollow noreferrer">haversine 公式。您可能需要进一步阅读并查看计算距离、方位等的实现纬度/经度点之间,作者:Chris Veness。

对于给定的纬度/经度,我如何从数据库/数组中获取附近距离的 POI?

如果您只有少数 POI,您可以简单地计算从您的点到每个 POI 的大圆距离。然后简单地按距离对结果列表进行排序。

但是,如果您将拥有许多 POI,则应考虑使用具有空间索引功能的数据库。 MySQLPostgreSQLSQL Server 2008 都具有地理空间功能(本机或通过扩展),其中包括空间索引和半正弦公式的实现。

I want to know what is the method/name/call to get all nearby POIs from a given position.

Calculating the great-circle distance between two latitude/longitude coordinates is easy with the haversine formula. You may want to read further and check out the implementation at Calculate distance, bearing and more between Latitude/Longitude points by Chris Veness.

For a given LAT / LONG how do I get from the database/array what POIs are nearby by distance?

If you will only have a handful of POIs, you can simply calculate the great-circle distance from your point to each POI. Then simply sort the result list by the distance.

However, if you will be having many POIs, you should consider using a database with spatial indexing capabilities. MySQL, PostgreSQL and SQL Server 2008 all have geo-spatial features (either natively or via extensions), which include spatial indexing and implementations of the haversine formula.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文