如何实现基于地理的数据存储和计算?

发布于 2024-09-03 21:56:37 字数 272 浏览 5 评论 0 原文

好吧,让我简单解释一下:

1.我想建立一个提供基于位置的服务的网站,例如 http:// fireeagle.yahoo.net/

2.我猜这些服务大部分都与经度和纬度有关。

3.是否有任何特定的数据库/数据存储/数据结构适合此类应用程序?我的意思是易于存储经度、纬度并且易于计算或易于使用。

我对此很陌生,欢迎任何反馈

Well, let me explain this briefly:

1.I want to build a website that provides location based services, like http://fireeagle.yahoo.net/ .

2.I guess most of these services have something do with longitude and latitude.

3.Is there any particular database/datastore/data structures fit well for such apps? I mean easy to store longitude, latitude and easy to compute or easy to use.

I am new to this and any feedbacks are welcome

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

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

发布评论

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

评论(3

把人绕傻吧 2024-09-10 21:56:37

关系数据库系统的空间扩展提供地理/几何数据类型的存储和索引访问。它们允许您执行空间连接和各种空间查询。简而言之,它们正是您所需要的。

如果您使用开源堆栈,我会推荐 PostGIS,Postgresql 的空间扩展。如果您使用的是 MS 堆栈,请尝试 SQL 空间扩展服务器 2008

Spatial extensions to relational database systems provide storage and indexed access the geography/geometry datatypes. They allow you to perform spatial joins and all sorts of spatial queries. In short, they are exactly what you need.

If you are using the open source stack I would recommend PostGIS, the spatial extension to Postgresql. If you are using the MS stack, try the spatial extensions to SQL Server 2008.

自在安然 2024-09-10 21:56:37

MySQL 有一个带有教程的空间扩展这里。获得快速查询的基本思想是设计一个带有空间索引列的表,一个 R-树索引,对于范围查询(例如“给我靠近这一点的点”)快速。

当然,还有带有 PostGIS 的 Postgres,您可以从 SimpleGeo 等公司购买这项服务。

MySQL has a spatial extension with tutorials here. The basic idea of getting fast queries is to design the table with a column with a spatial index, an R-tree index that's fast for range queries such as "give me points near this point."

Of course, there's Postgres with PostGIS and you could pay for this service from companies like SimpleGeo.

吃→可爱长大的 2024-09-10 21:56:37

我建议您考虑 GeoDjango
它非常好,因为它融合了 Python/Django 的简单性和 PostGIS 的强大功能。但它也可能很复杂并提供太多功能,从而浪费您的时间。

如果您没有特殊需求,还有另一种更简单的解决方案可以单独与 Django 或 Python 一起使用,即 入门页面,也可以直接访问代码,因为它有详细记录。我将它用于动态拼车项目,效果非常好。

这两种解决方案都非常适合 Django 框架,因此您可以轻松地围绕所提供的服务开发一个网站。

I would recommend you to consider GeoDjango
It is very nice, as it merges the simplicity of Python/Django and the power of PostGIS. But it can also be complex and provide too many features, therefore wasting your time.

If you don't have particular needs, there is another simpler solution to be used with Django or Python alone, that is Geopy. While not adding spatial extensions to a database, it allows you to perform Geospatial calculations using generic data structures (also any database). You can calculate distances, doing (reverse) Geocoding. Take a look at the Getting Started page, but also directly at the code, as it is well documented. I'm using it for a Dynamic Carpooling project and it works very well.

Both solutions fit well with the Django framework, so you coud easily develop a website around the services provided.

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