您如何执行地址验证?

编程入门 行业动态 更新时间:2024-10-25 21:28:52
本文介绍了您如何执行地址验证?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送ChatGPT账号..

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

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屋!

更多推荐

[db:关键词]

本文发布于:2023-04-28 07:31:21,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1169720.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:地址

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!