地理编码中可能存在错误 API

Possible bug in Geocoding API

在某些情况下,请求 ParsedRequest 对象(通过 responseattributes 参数)的地理编码器 API 请求在响应中不包含 ParsedRequest 对象。复现(app id 和代码省略):

curl https://geocoder.api.here.com/6.2/geocode.json\?jsonattributes\=1\&searchtext\=marghera+Venezia+Veneto+Italia\&language\=it-IT\&maxresults\=1\&app_id\=xxx\&app_code\=xxx\&responseattributes\=mq%2Cmt%2Cpr

作为地区正确匹配,但响应中不存在预期的 ParsedRequest 对象

相反,如果在之前的请求中我们将“marghera”更改为“san+marco”,则 ParsedRequest 对象会按预期出现:

curl https://geocoder.api.here.com/6.2/geocode.json\?jsonattributes\=1\&searchtext\=san+marco+Venezia+Veneto+Italia\&language\=it-IT\&maxresults\=1\&app_id\=xxx\&app_code\=xxx\&responseattributes\=mq%2Cmt%2Cpr 

这次它正确匹配为“街道”,并且 ParsedRequest 对象按预期出现在响应中。

仅从这个示例来看,当匹配的是一个地区时,似乎没有填充 ParsedRequest 对象。我还没有尝试过其他地区的样本。

不幸的是,文档没有提到它,但 ParsedRequest 将仅针对街道和门牌号级别的响应返回。

您的第一个示例 "Marghera, Venice, Veneto, Italy" 是区级结果,因此响应中没有 ParsedRequest。

https://developer.here.com/documentation/geocoder/topics/example-geocode-parsedrequest.html