Search code examples
here-api

Reverse Geocode an intersection


I'm using geocoding API to retrieve positions of point addresses and intersections. When trying to reverse geocode the exact position of an intersection, the reverse geocode API endpoint only returns match level "street" but no "intersection". Is there a possibility to configure the REVERSE geocoder to return intersections?

https://geocoder.api.here.com/6.2/geocode.json?app_id={YOUR_APP_ID}&app_code={YOUR_APP_CODE}&city=Chicago&street=State%20%40%20Madison&gen=9

The API call above returns following result: Match Level:"intersection" Label="S State St & W Madison St, Chicago, IL 60602, United States" Lat/Lon:41.88206,-87.6278

https://reverse.geocoder.api.here.com/6.2/reversegeocode.json?app_id={YOUR_APP_ID}&app_code={YOUR_APP_ID}&prox=41.88206,-87.6278&mode=retrieveAddresses&gen=9

The REVERSE geocode call above with lat/lon of intersection "S State St & W Madison St" returns following result: Match Level:"street" Label="E Madison St, Chicago, IL 60602, United States" Lat/Lon:41.88206,-87.6278

None of the results returned by the reverse geocoder API contains information about intersections. Do I have any chance to retrieve the location with label="S State St & W Madison St, Chicago, IL 60602, United States" in reverse geocoder API?

I already tried playing around with "gen" and "mode" request param, without success unfortunately.


Solution

  • There is a dedicated parameter to enable crossings in Reverse Geocoding to be returned:

    &additionaldata=IntersectionSnapTolerance,1
    

    IntersectionSnapTolerance: N (float in [0, 1]). When reverse geocoding a coordinate, the value controls how strictly an address match is snapped to the next intersection. A value of 0 indicates that no points on a link are snapped to an intersection; a value of 1 indicates that most probably a street intersection is returned as a match. Default value is 0.

    More info about additionaldata: