【发布时间】:2020-01-31 18:31:06
【问题描述】:
我使用以下 URL 获取意大利邮政编码的形状: https://geocoder.ls.hereapi.com/6.2/geocode.json?postalCode=08013&country=Italy&additionaldata=IncludeShapeLevel,postalCode
实际上,此 URL 几乎适用于所有邮政编码(例如 08012)。
但是,有一些(例如 08013)位置已定义但 Shape 属性不存在:
{"Response":{"MetaInfo":{"Timestamp":"2020-01-29T15:40:52.032+0000"},"View":[{"_type":"SearchResultsViewType","ViewId":0,"Result":[{"Relevance":1.0,"MatchLevel":"postalCode","MatchQuality":{"Country":1.0,"PostalCode":1.0},"Location":{"LocationId":"NT_CWJpjOLnf1bC2mdwnAMVkA","LocationType":"area","DisplayPosition":{"Latitude":40.33425,"Longitude":8.49083},"NavigationPosition":[{"Latitude":40.33425,"Longitude":8.49083}],"MapView":{"TopLeft":{"Latitude":40.4079,"Longitude":8.40124},"BottomRight":{"Latitude":40.26122,"Longitude":8.56773}},"Address":{"Label":"08013, Bosa, Sardegna, Italia","Country":"ITA","State":"Sardegna","County":"OR","City":"Bosa","PostalCode":"08013","AdditionalData":[{"value":"Italia","key":"CountryName"},{"value":"Sardegna","key":"StateName"},{"value":"Oristano","key":"CountyName"}]}}}]}]}}
当我将 additionaldata=IncludeShapeLevel,postalCode 更改为 city 或 country 时,它会返回 Shape 但显然这个形状不是我需要的邮政编码。
问题是 HERE Geocoder API 是否存在一些数据差距,或者这可以通过某种方式克服?
【问题讨论】: