您如何执行地址验证? [英] How do you perform address validation?

查看:21
本文介绍了您如何执行地址验证?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以执行地址(物理,而不是电子邮件)验证?似乎地址格式的数量之多,即使仅在美国,也会使这成为一项相当困难的任务.另一方面,这似乎是满足多项业务需求所必需的任务.

Is it even possible to perform address (physical, not e-mail) validation? It seems like the sheer number of address formats, even in the US alone, would make this a fairly difficult task. On the other hand it seems like a task that would be necessary for several business requirements.

推荐答案

这里有一种免费的开箱即用"的方式来做到这一点.不是 100% 完美,但它应该拒绝公然不存在的地址.

Here's a free and sort of "outside the box" way to do it. Not 100% perfect, but it should reject blatantly non-existent addresses.

将整个地址提交给 Google 的地理编码网络服务.此服务会尝试返回您提供给它的位置的准确坐标,即纬度和经度.

Submit the entire address to Google's geocoding web service. This service attempts to return the exact coordinates of the location you feed it, i.e. latitude and longitude.

根据我的经验,如果地址无效,您将从服务中得到 602 的结果.肯定存在误报或漏报的可能性,但与其他一致性检查结合使用可能会很有用.

In my experience if the address is invalid you will get a result of 602 from the service. There's definitely a possibility of false positives or false negatives, but used in conjunction with other consistency checks it could be useful.

(另一方面,雅虎地理编码网络服务如果城镇存在,但地址的其余部分是伪造的,则返回城镇中心的坐标.只要您密切注意结果中的精度"字段,就可能有用).

(Yahoo's geocoding web service, on the other hand, will return the coordinates of the center of the town if the town exists but the rest of the address is bogus. Potentially useful as long as you pay close attention to the "precision" field in the result).

这篇关于您如何执行地址验证?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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