使用 Google Maps API 进行地址验证 [英] Address validation using Google Maps API

查看:27
本文介绍了使用 Google Maps API 进行地址验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一项任务来验证输入到我当前创建的系统中的地址.系统要求输入的地址根据有效数据源进行验证.在英国,数据集来自皇家邮政,访问费用昂贵.

I have a task to validate addresses entered into a system I am currently creating. The system requires that address entered are validated against a valid data source. In the UK the dataset comes from the Royal Mail and is expensive to access.

所需的数据是整个欧洲的邮政编码信息,从通过 API 访问 Web 应用程序开始.

The data needed is post code info for the whole of europe to start with accessed by an API into the web application.

有许多公司提供此服务,

There are a number of companies that offer this service,

  1. 质量保证
  2. Capscan
  3. 任何地方的邮政编码

这些都提供了我需要的服务.然而,这是昂贵的,并且在某些情况下不是完整的数据集.例如不是爱尔兰

These all offer the service I require. However this is expensive and in some cases not a complete data set. e.g. not Ireland

我还想知道是否有办法利用 Google Maps API 通过邮政编码和国家/地区验证这些数据.

I was also wondering if there would be a way to utilize the Google Maps API to validate this data via postal code and country.

谷歌地图方法是否可行,还是我必须走这些昂贵公司之一的路线?关于我应该采取什么路线的任何想法.

Would the google maps method be possible or do I have to go down the line of one of these expensive companies? Any thoughts on what line I should take.

推荐答案

答案可能取决于获得该服务的支持和可能的定制对您来说有多重要.

The answer probably depends how critical it is for you to receive support and possible customization for this service.

谷歌当然可以做到这一点.查看他们的 XML 和地理编码 API.您应该能够制作一条 XML 消息,要求 Google 返回给定地址的地图坐标.如果未找到地址(无效),您将收到相应的回复.这是一个有用的页面:http://code.google.com/apis/maps/documentation/services.html#XML_Requests

Google can certainly do this. Look into their XML and Geocoding API's. You should be able to craft an XML message asking Google to return Map coordinates for a given address. If the address is not found (invalid), you will receive an appropriate response. Here's a useful page: http://code.google.com/apis/maps/documentation/services.html#XML_Requests

请注意,Google 提供 Maps API 的目的是在实际地图上绘制地址.虽然您当然可以将数据用于其他目的,但如果 Google 的地图之一不完全符合您的合法或商业地址验证需求,您将受制于 Google.如果您为您提到的其中一项服务付费,如果某些地址无法按您期望的方式解决,您可能会获得支持.

Note that Google's aim in providing the Maps API is to plot addresses on actual maps. While you can certainly use the data for other purposes, you are at the mercy of Google should one of their maps not exactly correspond to your legal or commercial address validation needs. If you paid for one of the services you mentioned, you would likely be able to receive support should certain addresses not resolve the way you expect them to.

换句话说,一分钱一分货;).但是,如果您有时间,为什么不尝试实施基于 Google 的解决方案,然后从那里开始呢?API 看起来非常漂亮,而且毕竟是免费的.

In other words, you get what you pay for ;) . If you have the time, though, why not try implementing a Google-based solution then going from there? The API looks pretty slick, and it's free, after all.

这篇关于使用 Google Maps API 进行地址验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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