Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/visual-studio-code/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Visual studio code 使用python从给定坐标获取地址_Visual Studio Code_Python_Coordinates_Street Address - Fatal编程技术网

Visual studio code 使用python从给定坐标获取地址

Visual studio code 使用python从给定坐标获取地址,visual-studio-code,python,coordinates,street-address,Visual Studio Code,Python,Coordinates,Street Address,我有一些经纬度坐标,我想用Python把它转换成一个特定的地址。你知道怎么做吗?谢谢你,我是新来的。你说的方法叫反向地理编码。 您可以使用Namingm(OSM)提供免费地理编码服务 from geopy.geocoders import Nominatim geolocator = Nominatim(user_agent="specify_your_app_name_here") location = geolocator.reverse("52.509669, 13.376294") pr

我有一些经纬度坐标,我想用Python把它转换成一个特定的地址。你知道怎么做吗?谢谢你,我是新来的。

你说的方法叫反向地理编码。 您可以使用Namingm(OSM)提供免费地理编码服务

from geopy.geocoders import Nominatim
geolocator = Nominatim(user_agent="specify_your_app_name_here")
location = geolocator.reverse("52.509669, 13.376294")
print(location.address)
或者,如果你想得到更好的结果,你可以使用需要API密钥的谷歌地理编码服务

from geopy.geocoders import GoogleV3
geolocator = GoogleV3(api_key='Your_API_Key')
location = geolocator.reverse("52.509669, 13.376294")
print(location.address)
看看相关的(可能是dup)-