Reverse Geocode an intersection - here-api

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.

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:
https://developer.here.com/documentation/geocoder/topics/resource-reverse-geocode.html and
https://developer.here.com/documentation/geocoder/topics/resource-params-additional.html

Can you please try the below request which will return the Intersection as match level in the response.
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
https://developer.here.com/documentation/geocoder/topics/example-geocoding-intersection.html
also check the combination of text to find the intersection.
https://developer.here.com/documentation/geocoder/topics/resource-geocode.html

Related

Can I restrict geocode results to a specific state in R?

I'm using the ggmap geocode with the Google maps API. I have vector of city names in Ohio (city), and I am trying to return coordinates for each of these cities. My code,
coordinates <- geocode(city)
Is mostly returning the correct coordinates, but many of the city names in Ohio are the same as those in other states, so I'm receiving a few incorrect coordinates. Is there an argument I can add to "geocode" so that it only returns coordinates from Ohio?
Thanks!

Why is prox parameter value not enforced in 6.2/reversegeocode?

Why does the 6.2/reversegeocode API call not limit the results according to proximity parameter prox?
Example:
https://reverse.geocoder.api.here.com/6.2/reversegeocode.json
?app_id=my_app_id
&app_code=my_app_code
&maxresults=10
&mode=retrieveAddresses
&prox=53.468052,-113.44846,50
Partial result includes this record:
{
"Relevance":1.0,
"Distance":82.2,
"MatchLevel":"houseNumber",
...
"MatchType":"interpolated",
...
"Address":{
"Label":"125 Lee Ridge Rd NW, Edmonton, AB T6K 0N1, Canada",
...
}
}
So my requested radius is 50m, but the distance to one of the results is 82.2.
Why?
For Geocoder API v6.2 three aspects come into play here:
For performance reasons, distance filter does a simplified (plane triangular) distance calculation only, which for the higher latitude might be deviating from the real distance (spherical calculation)
The returned distance is calculated towards the display point and might differ from the filtering distance which is the nearest of display or navigation point
Reverse Geocoder v6.2 uses a link-based spatial index only,meaning that radius is used to select nearest links within radius and from those
the nearest point-address or otherwise housenumber range interpolated house number is returned.
I would suggest using the new Geocoding & Search API (https://developer.here.com/documentation/geocoding-search-api/dev_guide/topics/endpoint-reverse-geocode-brief.html) Reverse Geocoder, results are a bit more predictable and better understandable:
https://search.hereapi.com/v1/revgeocode?limit=20&in=circle%3A53.468052%2C-113.44846%3Br%3D50&apikey=YOUR_API_KEY

TomTom reverse Geocode not returning street name for some gps coordinates

For some GPS coordinates, no street name is returned. For example
https://api.tomtom.com/search/2/reverseGeocode/47.532289,-122.251843.json?key=MYKEY&roadUse=[%22LocalStreet%22]&returnRoadUse=true
returns
{"summary":{"queryTime":102,"numResults":1},"addresses":[{"address":{"routeNumbers":[],"countryCode":"US","countrySubdivision":"WA","countrySecondarySubdivision":"King","countryTertiarySubdivision":"Seattle East","municipality":"Mercer Island","postalCode":"98040","municipalitySubdivision":"Mercer Island","country":"United States","countryCodeISO3":"USA","freeformAddress":"Mercer Island, WA 98040","boundingBox":{"northEast":"47.535094,-122.241410","southWest":"47.534766,-122.242287","entity":"position"},"countrySubdivisionName":"Washington"},"position":"47.534897,-122.242287","roadUse":["Publicly Accessible","LocalStreet","Terminal"]}]}
Which contains no street name. Is there anyway to tell the TomTom API to return results that ALWAYS include a street name?
This may be a hack, but if we create a pedestrian route starting with that location (in the middle of Lake Washington) the first instruction starts usually at the closest street that can be navigable, isn't?
These coordinates are pointing to a lake. And the nearest road is some living street with no name. So that is not a perfect example.

Different latitude and longitude using google maps and ggmap geocode function

I am trying to plot the nearest Walmart store in Canada to a certain post code using ggmap. The function used to get the location is:
goodPoint<-geocode("M1L2K1 walmart canada")
This returned the lat and lon:
> goodPoint
lon lat
1 -79.30113 43.72304
When I check Google map search using the same search term and get the latitude and longitude I get 43.728933,-79.29565.
The difference between the returned latitude and longitude is about 1.1 km, so quite significant.
Can anyone suggest why there is this difference when in the documentation it states that it uses Google Maps for the location? Any suggestions for ways around this?
Have you looked at the actual output from Google geocoder? The geocoder is not the same thing as the maps search. The geocoder resolves addresses, but it afaict does not perform searches such as "find a walmart near M1L2K1 canada".
https://maps.googleapis.com/maps/api/geocode/json?address=M1L2K1%20walmart%20canada&sensor=false
yields the following parsed address:
"formatted_address" : "Scarborough, Ontario M1L 2K1, Kanada"
...
"location_type" : "APPROXIMATE",
...
"types" : [ "postal_code" ]
So in fact, Google even tells you that this is a "postal code resolution" geocoding.
Again, geocoding does not equal search. "Walmart" is not a postal address, but a reasonable search term.

how to get the direction of a location in google map api

i want to get the Direction of location in lati longi
when i use google map api
then he return me lati long for city (27.19, 78.01) but i need position too
means N E W S how i can get them too like
(27.19 N , 78.01 E).
N for north and E for east. how i can get the flank or direction too.
If the latitude returned by Googles Maps API is a positive number, then it is N. If it is negative, then it is S.
If the longitude is positive, then it is E. If it is negative, then it is W.
One can easily calculate distance between two location with the help of Google Map APIs. Google Map APIs comes with a set of classes which helps in doing such tasks.
class GDirection, helps in getting the travel distance between the two different location.
check following link for its example :-
http://tajendrasengar.blogspot.com/2011/09/distance-between-two-locations-with.html

Resources