简体   繁体   中英

Encountered problem with geocoder Here API for searching island

I'm using https://geocoder.api.here.com/6.2/search.json , and when I make a search for "Ile de Ré, France" I have a response but in the object Address I have this :

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"

Instead of having the all island... Does someone know how to have the all island address instead of just having a road?

This is the resquest :

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

Thanks ! =)

It is not entirely clear from your question what your expected response is. If you are expecting a list of all addresses in the area, that is not supported.

If you are expecting to get the shape/area of the island as a polygon, then you need to use the mode "retrieveAreas" as Michael has stated above. This blog post on How to Get the Shape of an Area using the HERE Geocoder should hopefully answer most of your questions regarding this feature.

The API call you are looking for would be the following, which retrieves the postal code area around a location. Note that in order to get the location as a lat/long you need to first Geocoder "Ile de Ré, France" using the forward Geocoder.

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

However, the Geocoder can only retrieve areas such as postal codes, administrative districts, counties, etc. In this case, none of them correspond exactly to the island. For example the island has multiple postal codes and its county covers a much larger area.

You can use this code example I've built to experiment. Here's a screenshot made using this tool to show the area of a postal code on the island.

雷岛的邮政编码,使用 HERE 地理编码器的retrieveAreas 模式突出显示

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM