无法获得正确的python语法HERE映射反向地理编码

问题描述 投票:0回答:1

我想使用HERE api来反转地理编码lat / lon。我正在尝试如下:

geohere = here('{}, {}'.format(centroid.GetY(), centroid.GetX()), app_id='WCvPg4vFEghHoPxTaRGM', app_code='yfuHH1jW8oIg7ILD1CER4Q')

但是获得IndexError: list index out of range

什么是正确的语法?我可以使用命令行api,但想使用python。

这是文档:https://geocoder.readthedocs.io/providers/HERE.html

python geocoding here-api google-geocoder reverse-geocoding
1个回答
0
投票

由于您试图反转地理编码,您应该添加参数method,其值为'reverse',如下所示:

geohere = here('{}, {}'.format(centroid.GetY(), 
                centroid.GetX()), 
                app_id='<app_id>', 
                app_code='<app_code>', 
                method='reverse')`
© www.soinside.com 2019 - 2024. All rights reserved.