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.
Related
I currently have a POC working that retrieves places information using the Places HERE api by passing Lat and Long values. Our addresses are being converted to lat and long before the api is called and we fear we might be losing precision in the process. Instead of feeding the API the coordinates, is there a way to send the actual address and get the address information back? Business name, type, etc?
res = requests.get('https://places.cit.api.here.com/places/v1/discover/here?app_id=<>&app_code=<>&at='+str(lat)+','+str(long))
Based on what I see in the API docs (https://developer.here.com/documentation/places/dev_guide/topics_api/resource-search.html) the answer is no. You can see more detail here as well: https://developer.here.com/documentation/places/dev_guide/topics/location-contexts.html. Is there a particular example of where you think geocoding is returning bad results?
Use Geocoder API to get coordinates for address and then use these coordinates to make a request to Places API.
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 trying to geocode NYC high schools by using the Maps Geocoding API and the unique BN code assigned to each high school. For example, typing K733 into Google Maps results in a marker on MESA Charter High School in Brooklyn, NY. However, when I use the API url like so:
https://maps.googleapis.com/maps/api/geocode/json?address=K733
I keep getting "ZERO_RESULTS". I've also tried using the Places API and I've gotten the same results. Can anyone point me in the right direction? Is it even possible to pull this information from Google Maps?
It not possible to use unique BN codes for Maps Geocoding API because the address component requires postal address
address — The street address that you want to geocode, in the format
used by the national postal service of the country concerned.
Additional address elements such as business names and unit, suite or
floor numbers should be avoided. Please refer to the FAQ for
additional guidance.
It seems that the Routing API requires a Lat/Lon pair to be supplied to the Waypoint parameter. I've seen other APIs that allow for the actual address to be passed, instead of the Lat/Lon. I'm wondering if anyone knows of a way to do this with the Here.com API. In many instances I can obtain the Lat/Lon first, but in one instance it's proving to be a headache, especially given the nature of the way that the REST APIs work and the fact that I'm trying to batch-process a small group of addresses at a single time. Any help would be appreciated.
Unfortunately Routing API needs a waypoint in lat, lon and required a Geocoding as a pre-requisite.
Maybe a not so nice workaround if you are facing issues with Geocoding, the Duck Duck Go provides a syntax
https://duckduckgo.com/?q=!here Junghofstraße 14,60311 Frankfurt am Main,Germany, Germany&ia=about
But you will stll have to extract the lat,lon from the final redirected url.
i want to get ONLY the road name in google maps not exact address, using either the geocoder or the directions service.i tried this results[0].address_components[1].long_name but it returns several different names (not necesserily wrong) on the same road.
You need to do a reverse geocode lookup on the location. Google provide this: http://code.google.com/apis/maps/documentation/geocoding/
Read more here: http://en.wikipedia.org/wiki/Reverse_geocoding