国家列表
## 全球国家列表接口
-1. URL:
http://www.geognos.com/api/en/countries/info/all.json
-2. HTTP Method:
GET
-3. 返回格式说明
respond = {
'StatusMsg': 'OK',
'Results': {'<country_code>': {}, ...},
'StatusCode': '200'
}
##### 澳洲例子:
```
respond["Results"]["AU"] =
{
'Name': 'Australia',
'Capital': {'DLST': 1.0, 'TD': 10.0, 'Flg': 2, 'Name': 'Canberra', 'GeoPt': [-35.17, 149.13]},
'GeoRectangle': {'West': 112.911048889, 'East': 153.639282227, 'North': -10.0628032684, 'South': -43.6439743042},
'SeqID': 14,
'GeoPt': [-27.0, 133.0],
'TelPref': '61',
'CountryCodes': {'tld': 'au', 'iso3': 'AUS', 'iso2': 'AU', 'fips': 'AS', 'isoN': 36},
'CountryInfo': 'http://www.geognos.com/geo/en/cc/au.html'
}
相应的国家标识ICON图片地址:
http://www.geognos.com/api/en/countries/flag/AU.png
```
##### 根据用户当前位置,(经度,纬度),判断用户所在的国家
```
-1. 获取用户当前位置
cur_location = { 'latitude': xxx, 'longtitude': xxx}
-2. 提取国家的区域范围
au_geo_rectangle = respond["Results"]["AU"]["GeoRectangle"]
-3. 判断当前坐标 是否在 区域范围内
is_in_au = cur_location.latitude in [au_geo_rectangle.North, au_geo_rectangle.South] and cur_location.longtitude in [au_geo_rectangle.West, au_geo_rectangle.East]
```
##### 获取用户选择区域的移动号码 国家码
respond["Results"]["AU"]["GeoRectangle"]["TelPref"]