基于python的WGS84转百度坐标
from urllib.request import urlopen, quote import json def wgs84tobaidu(x,y): data=str(x)+','+str(y); output = 'json' url='http://api.map.baidu.com/geoconv/v1/?coords='+data+'&from=1&to=5&output=' +output+'&ak=百度地图密钥' req = urlopen(url) res = req.read().decode() temp = json.loads(res) baidu_x=0 baidu_y=0 if temp['status']==0: baidu_x=temp['result'][0]['x'] baidu_y=temp['result'][0]['y'] return baidu_x,baidu_y
脚踏实地,注重基础。