GPS坐标的国家名称 [英] Country name for GPS coordinates

查看:24
本文介绍了GPS坐标的国家名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有一种简单的方法可以获取给定点所在国家/地区的名称?

Is there an easy way to get the name of the country on whose territory a given point is located?

我不太关心准确性,也不太关心政治争端所带来的模棱两可.只需要一个足够好的近似值.

I don't care too much about accuracy nor about ambiguities given by political disputes. Just need a good enough approximation.

推荐答案

Yahoo Where API 不再可用.

The Yahoo Where API is no longer available.

试试 Yahoo!API.

纬度和经度

纬度和经度可以指定为位置参数.纬度和经度可以用十进制表示度或度-分-秒,带前导或尾随方向或主要标志.如果提供方向,经度可能出现在纬度之前.如果不提供方向,经度可能出现在纬度之前如果它超出 -90 到 90 的范围.否则必须出现纬度第一的.标点符号(逗号、度、分、秒)是忽略.

Latitude and longitude can be specified for the location parameter. Latitude and longitude may be expressed as decimal degrees or degrees-minutes-seconds, with either leading or trailing directionals or leading signs. If directionals are provided, longitude may appear before latitude. If directionals are not provided, longitude may appear before latitude if it is outside the range -90 to 90. Otherwise, the latitude must appear first. Punctuation marks (commas, degrees, minutes, seconds) are ignored.

Examples: 

•50.3 -120.5
•50.3, -120.5
•-120.5 50.3
•50.3 N 120.5 W
•120.5 W 50.3 N
•50 18 0 -120 30 0
•50 18 0 N 120 30 0 W
•50° 18' 0" N 120° 30' 0" W

响应元素将为您提供国家,以及许多其他 元素.

The response element will give you the country, as well as many other elements.

不要忘记将 gflags=R 作为参数发送,以进行反向地理编码.如果你想要 json 格式的输出,也发送参数 flags=J.

Don't forget to send as parameter gflags=R, to make the reverse geocoding. If you want the output in json, send the parameter flags=J as well.

这篇关于GPS坐标的国家名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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