我是一名学生,正在使用Here的REST API从事导航项目。
我要问的问题与使用Geocoder REST API和Here WeGo在线地图搜索位置时的差异有关。
我正在尝试通过Geocoder API使用搜索词“ Kent Ridge MRT”执行正向地理编码,以获取相应的坐标集。这是我国立新加坡大学校园内的地铁站。
使用以下参数
destination_input = "Kent Ridge MRT singapore"
country = "SGP"
gen = 9
这些放置在名为geocoding_params的字典中
geocoding_params = {"app_code": app_code, "app_id": app_id, "searchtext": destination_input,
"country": country, "gen": gen}
然后使用Python 3.7.3中的请求库通过
发出GET请求geocoding_data = requests.get(url = geocoding_base_url, params = geocoding_params)
geocoding_base_url = "https://geocoder.api.here.com/6.2/geocode.json"
请求为我提供了三个可能的位置,在此处列出了纬度/经度:(1.30098,103.77231),(1.29354,103.77138)和(1.2935,103.78102)。
这些都不是肯特岗地铁站(1.29364,103.78466)的实际坐标,当一个人使用Here WeGo输入完全相同的搜索词时就可以获取。
我很想知道为什么会存在这种差异,以及是否有办法获得我在Here WeGo中看到的东西。
到目前为止,我一直尝试通过删除country
和gen
参数来扩大搜索字段,同时保留searchtext = "Kent Ridge MRT singapore"
,但无济于事。结果与我上面获得的三个结果相符。
答案 0 :(得分:0)
为HereWeGo和GeocoderAPI提供支持的SearchAPI是具有不同方法和目标的不同服务。使用GeocoderAPI找不到地点“肯特岗MRT”的原因是因为GeocoderAPI不支持地点。
好消息:在HERE开放位置平台中,两者都统一为OpenSearch: https://developer.here.com/products/open-location-platform
在以下位置查看Open Location Platform文档: https://openlocation.here.com/resources/documentation