Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/363.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
Python 有没有一种方法可以使用requests包和heredeveloperapi获取街道和房屋号?_Python_Reverse Geocoding - Fatal编程技术网

Python 有没有一种方法可以使用requests包和heredeveloperapi获取街道和房屋号?

Python 有没有一种方法可以使用requests包和heredeveloperapi获取街道和房屋号?,python,reverse-geocoding,Python,Reverse Geocoding,我正在尝试对一些坐标进行反向地理编码,以获得最近的街道和房屋编号。我正在使用以下python代码: # api-endpoint URL = "https://revgeocode.search.hereapi.com/v1/revgeocode" #API key api_key = 'my_key' # Defining a params dictionary for the parameters to be sent to the API PARAMS = {

我正在尝试对一些坐标进行反向地理编码,以获得最近的街道和房屋编号。我正在使用以下python代码:

# api-endpoint
URL = "https://revgeocode.search.hereapi.com/v1/revgeocode"

#API key
api_key = 'my_key'

# Defining a params dictionary for the parameters to be sent to the API 
PARAMS = {
            'at': '{},{}'.format(latitud,longitud),
            'apikey': api_key,
         }

# Sending get request and saving the response as response object 
r = requests.get(url = URL, params = PARAMS) 
  
# Extracting data in json format 
#data.append(r.json()) 
data = r.json()
在某些情况下,我只知道附近某个地方的名字,比如餐馆的名字

我已经阅读了一些关于如何改变这一点的文档,但我没有能够正确地使用它,在某种程度上是因为我认为它是用Java编写的


如果您能提供任何帮助,我将不胜感激

您能举一个具体的例子说明何时会发生这种情况吗?我的意思是,您使用的纬度和经度是多少,您期望的是什么,以及API给您的答案。