从纬度,经度获取邮政编码? [英] Get zip code from latitude, longitude?

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

问题描述

我想从用户当前位置(纬度,经度)获取邮政编码,我曾使用MKReverse Geocoder委托方法,但有时我无法获得基于纬度和广度的邮政编码信息。经度(有效值)。 MKReverseGeocoder还有其他选择吗? ZipCode数据库特定于国家,这就是我不想使用它们的原因。还有其他想法或线索吗?

I want to get zip code from users current location(Latitude, Longitude), I had used MKReverse Geocoder delegate methods, but sometimes I am not able to get zip code information based on latitude & longitude (valid values). Are there any other alternatives for MKReverseGeocoder ? ZipCode database are specific to countries, that's why I don't want to use them. Any other idea or clue?

谢谢

推荐答案

考虑< a href =http://www.geonames.org/export/ws-overview.html =noreferrer> GeoNames网络服务。它是Creative Commons归属许可下的完整地理编码/反向地理编码套件。您可以下载他们的数据,也可以点击他们的网络服务。最棒的是,他们不需要任何API密钥或许可证愚蠢 - 你只需点击他们的网络应用程序就可以获得数据。

Consider the GeoNames web service. It's a complete geocoding/reverse geocoding suite under a Creative Commons attribution license. You can either download their data, or hit their web service. The best thing is, they don't require any API keys or licensing silliness--you just hit their web app and bang you got data.

这是一个例子:< a href =http://ws.geonames.org/findNearbyPostalCodesJSON?formatted=true&lat=36&lng=-79.08 =noreferrer> http://ws.geonames.org/findNearbyPostalCodesJSON?formatted=true&& ; lat = 36& lng = -79.08 这将为您返回北卡罗来纳州教堂山区域的邮政编码的JSON对象。

Here's an example: http://ws.geonames.org/findNearbyPostalCodesJSON?formatted=true&lat=36&lng=-79.08 That'll return you a JSON object for the zip codes around the Chapel Hill, NC area.

这也是国际性的。这是英格兰的Seaford,唯一的区别是我发送的lat / lng对: http://ws.geonames.org/findNearbyPostalCodesJSON?formatted=true&lat=50.5&lng=0.08

It's also international. Here's Seaford, England, and the only difference is the lat/lng pair I'm sending: http://ws.geonames.org/findNearbyPostalCodesJSON?formatted=true&lat=50.5&lng=0.08

然后你需要学习制作网页请求并解析JSON(如果你还没有掌握这些东西),那么你就已经完成了设置。

Then you need to learn to make web requests and parse JSON (if you don't already have a grip on those things), and you're all set.

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

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