i just got some strange results for a geocoding query sent to the API.
http://geocoder.cit.api.here.com/6.2/geocode.json?prox=-42.48014%2C-73.762414%2C10000&searchtext=al%20%2C%20Castro%20%2C%20Castro%20%2C%20cl&app_id=XXX&app_code=XXX&gen=3&maxresult=100&language=es
so the location is properly found on http://here.com/-42.4801399,-73.7604828,17,0,0,normal.day
but the API-response includes totally different information.
{"Response":{"MetaInfo":{"Timestamp":"2014-08-13T06:41:28.518+0000"},"View":[{"_type":"SearchResultsViewType","ViewId":0,"Result":[{"Relevance":0.9,"Distance":1.00628071E7,"MatchLevel":"street","MatchQuality":{"State":0.71,"City":0.89,"Street":[0.85]},"Location":{"LocationId":"NT_zSCm7jYDz+HltoMoaXf6NA","LocationType":"point","DisplayPosition":{"Latitude":36.7596283,"Longitude":-121.7462616},"NavigationPosition":[{"Latitude":36.7596283,"Longitude":-121.7462616}],"MapView":{"TopLeft":{"Latitude":36.7616081,"Longitude":-121.7468719},"BottomRight":{"Latitude":36.7576599,"Longitude":-121.7456436}},"Address":{"Label":"Castro St, Castroville, CA 95012, Estados Unidos","Country":"USA","State":"CA","County":"Monterey","City":"Castroville","Street":"Castro St","PostalCode":"95012","AdditionalData":[{"value":"Estados Unidos","key":"CountryName"},{"value":"California","key":"StateName"}]}}}]}]}}
Could you give me a helping hand to solve this?
Best regards,
Matthias :)
The question is 10000km away from where? The geocoder request you are making is effectively:
Find me somewhere in the world with "al, Castro,Castro, cl" somewhere in the
address
The result obtained happens to be in San Francisco, California which may or may not be 10000km from anywhere, but just happens to be the best fit result to the request.
What you probably want is something like:
Find me somewhere in Chile with "Castro" somewhere in the
address
http://geocoder.cit.api.here.com/6.2/geocode.json?searchtext=Castro&app_id=XXX&app_code=XXX&country=Chile
or
Find me somewhere within a specified rectangle San Francisco, California with "Castro" somewhere in the
address
http://geocoder.cit.api.here.com/6.2/geocode.json?searchtext=Castro&app_id=XXXX&app_code=XXXX&mapview=37.7983366,-122.4006509;37.7904096,-122.3916387
These biasing effects can be obtained using the mapview, country and countryfocus parameters as specified in the API Reference
Related
The HERE api seems really picky about what is uses for the q parameter in API calls. According to the documentation you can use a street address, partial address, name of place, etc (documentation: https://developer.here.com/documentation/places/topics/free-text-search.html)
Im trying to take an address and return the name of the store, building, business at that location (a few million of these) In some cases I have a human typed name of the place at the address but this can be quite messy and inaccurate in a lot of cases so Im trying not to use this information. Address however Im quite confident in.
in summary Im trying to provide here with an input like "15300 Cedar Ave, Apple Valley, MN 55124" and output "Best Buy"
Here seems to be really finicky on what your q input is..
When I put in the address and geocode info, Best Buy doesn’t appear on the results list
q=15300 Cedar Ave, Apple Valley, MN 55124
in=44.7287,-93.2147;r=800
https://places.demo.api.here.com/places/v1/discover/search?q=15300+Cedar+Ave%2C+Apple+Valley%2C+MN+55124&in=44.7287%2C-93.2147%3Br%3D800&Accept-Language=en-US%2Cen%3Bq%3D0.9&app_id=DemoAppId01082013GAL&app_code=AJKnXv84fjrb0KIHawS0Tg
Based on this Im thinking maybe this info just isnt in here's database, but when I run this query which includes best buy in the search it finds it right away at the correct address!!
q=best buy 15300 Cedar Ave, Apple Valley, MN 55124
in=44.7287,-93.2147;r=800
https://places.demo.api.here.com/places/v1/discover/search?q=best+buy+15300+Cedar+Ave%2C+Apple+Valley%2C+MN+55124&in=44.7287%2C-93.2147%3Br%3D800&Accept-Language=en-US%2Cen%3Bq%3D0.9&app_id=DemoAppId01082013GAL&app_code=AJKnXv84fjrb0KIHawS0Tg
It seems like a no-brainer to me that HERE would use the q value as an address search but that doesnt always appear to be the case. Looking for guidance on how to make this smarter
if the point of interest(POI) needs to be searched by specific address, then q is significant for fetching the records. As the API will fetch only those records which have those keywords in that area.
if POIs need to be searched at specific lat-long and around defined meter range, then q is not significant.
https://places.demo.api.here.com/places/v1/discover/around?in=44.7287%2C-93.2147%3Br%3D800&Accept-Language=en-US%2Cen%3Bq%3D0.9&app_id=DemoAppId01082013GAL&app_code=AJKnXv84fjrb0KIHawS0Tg
Is it mandatory for you to pass address all the time, or lat-long can also work ?
For routes that start and end in the US, HERE fails to suggest a route that goes through Canada even when I choose 'mode=fastest', and via Canada would clearly be the fastest route (traffic disabled).
e.g. Detroit to Buffalo
HERE We Go
HERE Routing API gives the same as HERE We Go. I use traffic disabled, hence a route through Canada is definitely the fastest: https://route.api.here.com/routing/7.2/calculateroute.json?waypoint0=42.33239,-83.04887&waypoint1=42.95594,-78.90584&mode=fastest;car;traffic:disabled&app_id=______&app_code=____
These places are just inside the US border. If I edit one co-ordinate to fall just inside the Canadian border, a route through Canada is recommended.
I can't find any restrictions that seem to be applied that would prevent routes going through Canada. I've tried examples in other countries which seem to be fine (e.g. a route starting and ending in Sweden was chosen to pass through Norway). What is going on here?
Can you please use fleet telematics with advance mapping options. Also if waypoint doesn't work, you can pass link ID or street to get the accurate result. please refer below documentation for more reference.
https://developer.here.com/documentation/fleet-telematics/api-reference.html
Also report the map team if the route is still incorrect using feedback API :
developer.here.com/documentation/map-feedback/dev_guide/topics/quick-start-submit-feedback.html
I'm reviewing HERE API, and I can't figure this issue:
I'm interesting in Geocoder API, and I tried the following query:
http://geocoder.cit.api.here.com/6.2/geocode.json?
&app_id=***
&app_code=***
&searchtext=london
&bbox=41.9085286,-87.6762943;41.8682739,-87.6041965
&gen=8
The bonding box I defined is around Chicago USA, so I expect to get no results.
But the response contains London information and I cant figure why.
I read in this question that If I use the landmark request the bbox is not always taken into consideration.
But here i'm using geocode requirest.
The geocoder does include prominent results (like London in this case) in the response in case of bbox, maybe you can use country as an additional filter ?
I am using Google Maps API v3 Distance. It has worked well for the majority of the addresses in my database. However, it seems like some addresses just aren't available in Google Maps, and it seems to pick the closest street address match which could be way off. I would expect Google Maps in this case to provide an answer based on city and zip. Does anyone have a solution? I've thought of double checking mathematically by geocode and checking Yahoo maps(or other sites) for the ones that are way off but that adds processing time and is not a very elegant solution. There must be some setting I'm missing or other such work around.
Thanks!
BTW shout out to the new Json Serializer! Well it was new to me anyways.
How are you formatting the address you are sending ?
I've used the Google Maps API to do some reverse geocoding and if a street could not be found (due to a typo or what have you) Google would return the lat lng for the historic town center.
I structured addresses as Country, city cityzip, street nr.
You should use the location_type of the geometry object to determine what accuracy was returned. I suggest checking to see if the returned resulsts indicate whether a result is anything other than ROOFTOP or RANGE_INTERPOLATED.
I am writing an application which requires to put a marker on a street within one city. I've added an input for searching this particular street (to simplify the process and not have to drag and locate the street manually).
So, entering "[Street name], [City]" works as expected and locates the street perfectly. However enetering only "[Street name]" centers map on the street but in another city.
Is there a way to tell Geocoder to search in a particular city?
In the end I can manually add ", [City]" to the request but I'm wondering if it's possible through the API.
You can tell the geocoder to bias towards a particular area:
https://developers.google.com/maps/documentation/javascript/geocoding#GeocodingViewports
Note: this is not entirely foolproof: it biases, it doesn't restrict. So if you look for "Downing Street" in a tiny village it may well find Downing Street in London anyway.
The only foolproof way is to force the city into the address.