def locatebyLatLng(lat, lng, pois=0):
'''
根据经纬度查询地址
'''
items = {'location': str(lat) + ',' + str(lng), 'ak': '你自己申请的百度ak', 'output': 'json'}
res = requests.get('http://api.map.baidu.com/geocoder/v2/', params=items)
result = res.json()
print(result)
print('--------------------------------------------')
#result = result['result']['formatted_address'] + ',' + result['result']['sematic_description']
result = result['result']['addressComponent']['city']
return result
作者:倾城and之恋
来源:CSDN
原文:https://blog.csdn.net/liyang12622/article/details/79027977
版权声明:本文为博主原创文章,转载请附上博文链接!