什么pre-现有服务来计算两个地址之间的距离存在吗? [英] What pre-existing services exist for calculating distance between two addresses?

查看:144
本文介绍了什么pre-现有服务来计算两个地址之间的距离存在吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想实现的方式来显示存储的地址依接近一个给定的地址的列表。

I'd like to implement a way to display a list of stored addresses sorted by proximity to a given address.

在列表中的地址将被存储在数据库表中。独立部件不同的领域(我们已为邮政code,城市名等领域),所以它不只是一个巨大的 VARCHAR 。这些是用户输入的,并由于系统的性质,可以不总是完全的(一些可能会丢失邮政code和其他可具有比城市和州更小)。

Addresses in the list will be stored in a database table. Separate parts have separate fields (we have fields for postal code, city name, etc.) so it is not just a giant varchar. These are user-entered and due to the nature of the system may not always be complete (some may be missing postal code and others may have little more than city and state).

尽管这是一个Intranet应用程序我有利用外部资源,包括访问互联网的Web服务,并没有这样的问题。其实我preFER,超过我自己的滚动,除非这将是微不足道的做我自己。如果谷歌或雅虎已经提供了一个免费的服务,我更愿意将其签出。关键字是它必须​​是免费的,因为我不能随便提出任何额外费用到这个项目中使用此功能,因为它已经是一个奖金振作可以这么说。

Though this is for an intranet application I have no problems using outside resources including accessing internet web services and such. I'd actually prefer that over rolling my own unless it would be trivial to do myself. If Google or Yahoo! already provides a free service, I'm more than willing to check it out. The keyword is it must be free, as I'm not at liberty to introduce any additional cost onto this project for this feature as it is already a bonus "perk" so to speak.

我想这就像许多砖和放大器;砂浆店做他们的查找位置功能。显示在一个简单的表排序适当并显示距离(比如说英里)是伟大的。显示地图混搭显得凉爽,但我可以肯定住在一起刚开的距离回来,我处理所有后续的显示和排序。

I'm thinking of this much like many brick & mortar shops do their "Find a Location" feature. Showing it in a simple table sorted appropriately and displaying distance (in, say, miles) is great. Showing a map mash-up is even cooler, but I can definitely live with just getting the distance back and me handling all of the subsequent display and sorting.

用简单的距离的算法的问题是数据的性质。由于所有的地址或部分可以是不确定的,我没有什么方便的像纬度/经度的coords。此外,即使我做的邮政codeS要求,90%的地址将可能有相同的五个邮政codeS。

The problem with simple distance algorithms is the nature of the data. Since all or part of the address can be undefined, I don't have anything convenient like lat/long coords. Also, even if I make postal codes required, 90% of the addresses will probably have the same five postal codes.

虽然它不一定是极快,任何时间超过7秒钟显示因等待时间可能过长对于普通用户等待网页上,因为我们知道。如果这种假设的服务支持发送查询一次的一批地址的一次,而不是,那会是巨大的。不过,我没有想到的地址的列表将超过50总,如果很多。

While it need not be blisteringly fast, anything that takes more than seven seconds to show up on the page due to latency might be too long for the average user to wait, as we know. If such a hypothetical service supports sending a batch of addresses at once instead of querying one at a time, that'd be great. Still, I should not think the list of addresses would exceed 50 total, if that many.

推荐答案

谷歌雅虎都提供地理编码服务是免费的。您可以使用半正矢公式(的 /KB/cs/distancebetweenlocations.aspx">implemented)。这两种服务将让你做局部搜索(邮政编码code只,仅市),并让你知道其结果的precision是(这样就可以排除没有有意义的信息的位置,但雅虎提供了更多的$ P比谷歌$ pcision信息)。

Google and Yahoo! both provide geocoding services for free. You can calculate distance using the Haversine formula (implemented in .NET or SQL). Both services will let you do partial searches (zip code only, city only) and will let you know what the precision of their results are (so that you can exclude locations without meaningful information, though Yahoo! provides more precision info than Google).

这篇关于什么pre-现有服务来计算两个地址之间的距离存在吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆