百度API
使用百度坐标
1、访问方式一
http://api.map.baidu.com/geocoder/v2/?location=35.063592,118.38513&output=json&ak=WEc8????7lRKgbid6Y
结果:
{ "status":"OK", "result":{ "location":{ "lng":117.121901, "lat":36.682243 }, "formatted_address":"山东省济南市历下区奥体中路", "business":"", "addressComponent":{ "city":"济南市", "direction":"", "distance":"", "district":"历下区", "province":"山东省", "street":"奥体中路", "street_number":"" }, "cityCode":288 } }
问题:有时获取不到。获取的格式化地址与方式二相同。
2、访问方式二
http://api.map.baidu.com/geocoder?location=35.063592,118.38513&output=json&ak=WEc8????7lRKgbid6Y
结果:
{"status":0,"result":{"location":{"lng":117.12190100736793,"lat":36.68224284735439},"formatted_address":"山东省济南市历下区奥体中路","business":"","addressComponent":{"country":"中国","country_code":0,"country_code_iso":"CHN","country_code_iso2":"CN","province":"山东省","city":"济南市","city_level":2,"district":"历下区","town":"","adcode":"370102","street":"奥体中路","street_number":"","direction":"","distance":""},"pois":[],"roads":[],"poiRegions":[],"sematic_description":"新疆特色花海子陕甘风味附近10米","cityCode":288}}
实际位置:
说明:
百度API返回了两部分信息:【山东省济南市历下区舜华西路】是格式化的地址;【银荷大厦-东南门附近29米】是提示信息。
百度API返回提示信息里基本都是XX附近多少米。
高德API
使用高德坐标
http://restapi.amap.com/v3/geocode/regeo?key=您的key&location=117.130967881945,36.673222113716&poitype=&radius=1000&extensions=all&batch=false&roadlevel=0
结果:
实际位置同上。
说明:
返回的是“山东省济南市历下区舜华路街道威海市商业银行(济南高新区支行)银荷大厦”。
高德API一般会带坐标建筑或坐标单位,但有时会忽略道路名称。
谷歌API
需要翻墙。略。