用python 实现把经纬度坐标对应到各个城市的方法
参考文献地址http://www.cnblogs.com/giserliu/p/4982187.html
1.安装geopy
(1)可以用pip install geopy
(2)pycharm中选择file-setting-Projectuntitled-project Interpreter
2.程序代码
2.1反地理编码(将经纬度对应到城市)
from geopy.geocoders import Nominatim geolocator = Nominatim() location = geolocator.reverse("51.43, 126.39") print(location.address)
2.2地理编码(城市对应到经纬度)
from geopy.geocoders imp