根据经纬度获得邮政编码长? [英] Get zip code based on lat & long?

查看:118
本文介绍了根据经纬度获得邮政编码长?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有可以ping的服务或API,并将纬度/长度作为参数传入,在那里返回纬度/长度对所在的邮政编码?这是美国专用的,所以我不必担心国际代码等。



我觉得Google Maps的反向地理编码对我来说太重了。如果可能的话,我更喜欢更轻的东西。这将在JavaScript中完成。

解决方案

它被称为反向地理编码(地址查找)。使用参数 http://maps.googleapis.com/maps/api/geocode/json > latlng = 40.714224,-73.961452& sensor = true ( example ),它返回JSON对象或使用 http://maps.googleapis.com/maps/api/geocode/xml 来返回XML响应(示例)。它来自Google并且免费。


Is there a service or API I can ping, and pass in the lat/long as parameters, where it returns the zip code that lat/long pair is within? This is US-only, so I don't have to worry about international codes, etc.

I feel like Google Maps' reverse-geocoding is too heavy for me. I'd prefer something lighter, if possible. This will be done in javascript.

解决方案

It is called Reverse Geocoding (Address Lookup). To get address for lat: 40.714224, lng: -73.961452 query http://maps.googleapis.com/maps/api/geocode/json with parameters latlng=40.714224,-73.961452&sensor=true (example) and it returns JSON object or use http://maps.googleapis.com/maps/api/geocode/xml to return XML response (example). It's from Google and it's free.

这篇关于根据经纬度获得邮政编码长?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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