无法获得 python HERE 映射的正确语法反向地理编码
Unable to get correct syntax of python HERE maps reverse geocoding
我想在这里使用 api 来反向地理编码 lat/lon。我正在尝试如下:
geohere = here('{}, {}'.format(centroid.GetY(), centroid.GetX()), app_id='WCvPg4vFEghHoPxTaRGM', app_code='yfuHH1jW8oIg7ILD1CER4Q')
但是得到 IndexError: list index out of range
.
正确的语法是什么?我可以使用命令行 api 但想使用 python 命令行。
由于您正在尝试反向地理编码,因此您应该添加值为 'reverse'
的参数 method
,如下所示:
geohere = here('{}, {}'.format(centroid.GetY(),
centroid.GetX()),
app_id='<app_id>',
app_code='<app_code>',
method='reverse')`
我想在这里使用 api 来反向地理编码 lat/lon。我正在尝试如下:
geohere = here('{}, {}'.format(centroid.GetY(), centroid.GetX()), app_id='WCvPg4vFEghHoPxTaRGM', app_code='yfuHH1jW8oIg7ILD1CER4Q')
但是得到 IndexError: list index out of range
.
正确的语法是什么?我可以使用命令行 api 但想使用 python 命令行。
由于您正在尝试反向地理编码,因此您应该添加值为 'reverse'
的参数 method
,如下所示:
geohere = here('{}, {}'.format(centroid.GetY(),
centroid.GetX()),
app_id='<app_id>',
app_code='<app_code>',
method='reverse')`