查找两个英国地址之间的距离

发布于 2024-08-25 06:51:07 字数 354 浏览 9 评论 0原文

我需要编写一个应用程序来计算两个英国地址之间的估计驾驶距离;我想我可以按以下方式使用 Google:

http://maps .google.com/maps/nav?q=from:London%20to:Dover

但是,有人知道从单个 IP 地址查询数据库的每日/每月限制是多少吗?

我需要在商业应用程序(货运服务)中实施,有没有可靠的替代方案?我可以花一些钱;但“一些”;

开发语言/平台:C#、.NET

问候,

I need to write an application which is to calculate the estimated driving distance between two UK addresses; I think I can use Google as following:

http://maps.google.com/maps/nav?q=from:London%20to:Dover

However, anyone knows what is the daily/monthly limit of querying the database from a single IP address?

I need to implement in a commercial application (freight services), is there any reliable alternative? I can spend some money; but 'some';

Development language/platform: C#, .NET

Regards,

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

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

发布评论

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

评论(7

巷雨优美回忆 2024-09-01 06:51:07

您可以使用 OpenStreetMaps 数据库并自己进行计算,
但这会涉及一些编码。

You could use OpenStreetMaps database and do the calculation yourself,
but that would involve some coding.

南冥有猫 2024-09-01 06:51:07

如果您只关心粗略估计,您可以在 postgis 中使用 openstreetmap 和 pgrouting。如果您只是在城市之间进行操作,那么您实际上不必担心地理编码,因为经纬度城市是众所周知的。

如果您的服务仅限于英格兰,我会保留一个大型数据库表,其中包含前 5000 个城市的成对距离的组合。使用 pgrouting 离线计算一次,然后在收到请求时调用它。对于大多数用户来说,这将使应用程序更快。

所有主要地图播放器都有路由 API(Yahoo、Bing、MapQuest、Nokia)
您还可以查看 deCarta 以获得相同类型的服务。在相当长的一段时间内,它们是雅虎和谷歌背后的 LBS 引擎。

[更新]如果您只是为了粗略估计而这样做,您真的需要进行路由还是可以只进行直线距离。直线的求解要简单得多。您只需要城市中心的经纬度,无需街道网络数据或进行路线计算。

You could use openstreetmap with pgrouting in postgis if all you care about is rough estimates. If you are just doing city to city then you really don't have to worry about geocoding all that much since the lat longs cities is fairly well know.

If your service is constrained to England I would keep a large DB table of the combinations for the pairwise distance of the top 5000 cities. Compute it once offline using pgrouting and then call that when the request comes in. This would make the app much much faster for most of your users.

All the major map players have routing APIs (Yahoo, Bing, MapQuest, Nokia)
You could also look at deCarta for the same kind of service. They were the LBS engine behind Yahoo and Google for quite some time.

[update] if you are just doing this for a rough estimate do you really need to do routing or can you just do straight line distance. Straight line is much much simpler to solve. You just need the lat longs for the centers of the cities without the street network data or doing the routing calculations.

他是夢罘是命 2024-09-01 06:51:07

截至 4 月 1 日,The Ordnance Survey 已发布大量数据,包括免费的 Code-Point 产品 从他们的网站下载。它还被MySociety 镜像,其中包括转换为 WGS84 坐标(即使用的坐标)通过 GPS 设备),然后计算两点之间的大圆距离就相当简单了 - 如果数据库中有这些点,那么它可以成为 SQL 查询的一部分。

如果您需要更准确的实际行驶距离,您还可以下载 Meridian 数据,并实现一个相当基本的路由算法(Djakstra 在这里可能有意义)

As of April 1st, The Ordnance Survey have released a lot of their data, including their Code-Point product as a free download from their website. It has also been mirrored by MySociety which includes conversion to WGS84 co-ordinates (i.e. those used by GPS devices) from which it would then be fairly trivial to calculate the great circle distances between the two points - trivial enough that it could be part of a SQL query if you have the points in a database.

If you need to be more accurate for actual driving distances, you could also download the Meridian data, and implement a fairly basic routing algorithm (Djakstra might be meaningful here)

风追烟花雨 2024-09-01 06:51:07

通常,大多数道路形状文件对于每个路段都有一个 begin_address/end_address 字段,您可以在其中插入地址。最重要的是,你在收集和组织地址数据时遇到了 GIS 问题,我认为 NP 问题是更简单的问题。

查看 postgis。您可以将形状文件转换为它。 irc.freenode.net 上的 irc room #postgis 非常有帮助,所以有邮件列表吗?

Usually, most road shapefiles have a begin_address/end_address fields for each road segment where you can interpolate the addresses. The bottom line is that you have a GIS problem manifesting in gathering and organizing the address data, the NP stuff in my opinion is the simpler problem.

Look into postgis. You can convert shape files to it. the irc room #postgis on irc.freenode.net is extremely helpful so is there mailing list.

您可以在商业某些类型应用程序中合法使用Google 地图。他们授予您许可证和 API 密钥以嵌入您的页面代码中。当然,也有一些限制。请参阅 http://code.google.com/apis/maps/terms.html。

[编辑以澄清。如果你不直接从中赚钱,你可以使用它,这就是OP的意图。]

You can legally use Google Maps in commercial certain types of applications. They grant you a license and an API key to embed in your page code. There are, of course, some restrictions. See http://code.google.com/apis/maps/terms.html.

[Edited to clarify. You can use it if you're not making any money directly from it, which was the OP's intent.]

寒尘 2024-09-01 06:51:07

每次查询 2-5 便士怎么样,即用即付,通过 postcodeanywhere.co.uk。他们与 AA 合作,因此他们的数据可能相当准确和完整。

可能会节省您一些开发时间(这也可以转化为金钱)。向精算师核实每个报价是否值 2 便士。如果没有,您可以通过他们的服务运行 X 个最受欢迎的旅行并缓存结果(可能违反他们的条款和条件,请先检查)。

How about 2-5 pence per query, pay-as-you-go, through postcodeanywhere.co.uk. They work with the AA, so their data is probably quite accurate and complete.

Might save you some development time (which also translates to money). Check with the bean counters whether it's worth 2 pence per quote. If not, you could possibly run the X most popular trips through their service and cache the results (might violate their terms and conditions, check first).

怀中猫帐中妖 2024-09-01 06:51:07

我已经使用 Google 地图解决了这个问题,并且使用 Newtonsoft JSON 编写了自定义 API。

我还没有在博客上的任何地方发布解决方案(很快就会发布)。

如果有人有兴趣获得一段代码,请联系我。

I have solved the problem using Google Maps and I have written custom API using Newtonsoft JSON.

I haven't yet posted solution anywhere on blog ( will do soon ).

If anyone is interested in getting piece of code, please ping me.

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