纬度经度位置的国家/地区代码(不使用地理编码服务) [英] Country code from a latitude longitude position (without using geocoding services)

查看:165
本文介绍了纬度经度位置的国家/地区代码(不使用地理编码服务)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何从经度位置获取国家/地区代码?

How can i get the country code from a latitude longitude position?

我知道有很多可用的地理编码服务,但是它们没有满足我的要求,因为我的应用程序上线后几个小时就被阻止了(许多地理编码请求).

I know that there are many geocoding services available, but they don't meed my requirement because my application gets blocked a few hours after it goes live (many geocoding requests).

大多数地理编码服务还提供商业服务,但由于该项目处于起步阶段,因此尚未成为一种选择.

Most geocoding services also offer commercial services, but they are not yet a option because the project is in it starting blocks.

我做了一些研究,认为我找到了一种方法: 获取一个形状文件(或其他数据文件),其中包含所有国家/地区的边界(以多边形表示). 接下来,只需查看纬度/经度位置在哪个多边形中. 最后,从特定的多边形读取元数据.

I did a bit of research and think i found a way to do it: Get a shape file (or other data file) that contains the borders of all countries (in polygons). Next just look in which polygon the lat/lng position is. Finally read the meta data from the specific polygon.

有人知道我在哪里可以得到一个形状文件(或其他格式),其中包括显示世界上所有国家/地区的边界的多边形(或只是线条)?

Does anyone know where i can get a shape file (or other format) that includes polygons (or just lines) that show the borders of all countries in the world?

或者也许有更简单的方法来解决此问题?

Or is there maybe a easier way to solve this problem?

推荐答案

鉴于世界上的国家(多边形)数量,您可能希望细分国家/地区多边形集,以便首先进行粗略过滤(例如,如果问题是在西半球和北半球,只需要检查北美,中美洲和加勒比海国家/地区即可,这可能会改善您的速度.

Given the number of countries (polygons) in the world, you may want to subdivide the set of country polygons to do a rough filter first (e.g., if the point is in the western and northern hemispheres, only need to check North American, Central American, and Carribean countries. That may give you a speed improvement.

此外,请记住,许多国家/地区都由多个多边形组成,因此在编写代码时请记住这一点.

Also, keep in mind that many countries consist of multiple polygons, just keep that in mind as you code.

我没有将这些来源中的任何一个用于国家边界数据,但是结帐: http://geocommons.com/overlays/33578 http://geospatial.edublogs.org/2010/06/29/world-country-boundary-files/

I haven't used any of these sources for country boundary data, but checkout: http://geocommons.com/overlays/33578 and http://geospatial.edublogs.org/2010/06/29/world-country-boundary-files/

这篇关于纬度经度位置的国家/地区代码(不使用地理编码服务)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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