这里使用地址解析器遇到的问题,用于搜索孤岛的API

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

[我使用的是https://geocoder.api.here.com/6.2/search.json,当我搜索“法国法兰西岛”时,我收到了答复,但在“地址”中却显示了这个:

Address: {Label: "D735, 17000 La Rochelle, France", Country: "FRA", State: "Nouvelle-Aquitaine",…}
Label: "D735, 17000 La Rochelle, France"
Country: "FRA"
State: "Nouvelle-Aquitaine"
County: "Charente-Maritime"
City: "La Rochelle"
Street: "D735"
PostalCode: "17000"

而不是全岛...有人知道如何拥有全岛地址,而不是只有一条路吗?

这是要求:

https://geocoder.api.here.com/6.2/search.json?language=fr&app_id={APPID}&app_code={APPCODE}&searchtext=%C3%8Ele%20de%20R%C3%A9&additionaldata=IncludeShapeLevel%2C%20default&gen=9&mapview=46.14288%2C-1.5629%3B46.2582%2C-1.25416

谢谢! =)

here-api
2个回答
0
投票

尝试将mode=retrieveAreas添加到您的API调用中


0
投票

您的问题尚不清楚,您期望得到的答复是什么。如果您希望将岛的形状/区域作为多边形获取,则需要使用迈克尔在上面提到的“ retrieveAreas”模式。

How to Get the Shape of an Area using the HERE Geocoder上的博客文章有望回答您有关此功能的大多数问题。

您正在寻找的API调用如下,它将检索位置附近的邮政编码区域。请注意,为了获得经纬度位置,您需要先使用向前的Geocoder来使用Geocoder“法国的Ile deRé”。

https://reverse.geocoder.ls.hereapi.com/6.2/reversegeocode.json
?apiKey=YOUR_API_KEY
&prox=46.20054,-1.39985
&mode=retrieveAreas
&additionaldata=IncludeShapeLevel,postalCode

但是,Geocoder只能检索邮政编码,行政区,县等区域。在这种情况下,它们中的任何一个都不完全符合该岛。例如,该岛有多个邮政编码,其县所覆盖的区域更大。

您可以使用我为进行实验而构建的this code example。这是使用此工具制作的屏幕截图,用于显示岛上邮政编码的区域。

Postal code on the Ile de Ré, highlighted using the retrieveAreas mode of the HERE Geocoder

© www.soinside.com 2019 - 2024. All rights reserved.