Ireland are using a post code system called "Eircode" which is valid layer in google maps and searching an Eircode e.g D03E5Y8 will result in the correct address on the Google map - much like UK / US zips.
https://www.google.ie/maps/place/Drumcondra,+Dublin,+D03+E5Y8/#53.3608019,-6.2560623,17z/data=!3m1!4b1!4m5!3m4!1s0x48670e639f49ad8d:0xfe32bee99c51f2ee!8m2!3d53.3607987!4d-6.2538683?hl=en
I was using an api call like below with a valid Eircode in the origins value. The lookup was working perfectly up to 1-2 days ago (Feb 19th /20th, 2018) - however it now returns a null value (please replace the key with your own API key)
https://maps.googleapis.com/maps/api/distancematrix/json?origins=D03+E5Y8&destinations=dublin&language=en-EN&key=xxxxxxxxxxxxxxxxxxxxxxxxxx&sensor=false
Previously the distance matrix worked with Google maps and you could enter 2 eircodes into origins= and destinations=
To illustrate further entering a valid UK post code into the origins value
https://maps.googleapis.com/maps/api/distancematrix/json?origins=ll652ez&destinations=dublin&language=en-EN&key=xxxxxxxxxxxxxxxxxxx&sensor=false
results in a correct call.
Have Eircode or Google maps now disabled this functionality for Eircode lookups? This would seem like a major step backwards!
Appreciate any help on this before I go back to the drawing board!
SOLUTION
Add +ire to the Eircode value origins=T12KC86+ire&destinations=V92YP93+ire
Related
Is there a way by using azure-maps or google-maps to get from longitude and latitude all postal codes and municipalityes that are in range of X kilometers?
I've yet checked the Get Search Nearby of azure, but it returns only points of interests and it is not possible to specify in the API a range in which the data should be get.
In Azure Maps, getting all postal code/municipalities within a specified distance of a location or within an area is not currently available. However, this is something being investigated as a possible future service. Consider submitting this as a feature request here: https://feedback.azure.com/forums/909172-azure-maps
I don't believe Google Maps has any such service either.
I am trying to geocode user entered data using the Google maps API, and got an error for the Australian postal code "2010"
maps.google.com/maps/api/geocode/json?components=country:AU|postal_code:2010
However, if I search in Google maps, I get a result. Am I doing something wrong in my request?
Your request is completely OK, but unfortunately, Google experience issues with searching 4-digit postal codes. This bug has already been reported in Google issue tracker and you can see it here:
4-digit postal codes are hard to geocode (AT, AU, BE, DK, NZ, SI)
I would suggest starring the bug to add your vote and subscribe to further notifications from Google.
Also you can see that suggested workaround by Google is using place autocomplete request with types (region) and country components filter.
So, in your case you can run the following query
https://maps.googleapis.com/maps/api/place/autocomplete/json?input=2010&types=(regions)&components=country%3AAU&key=YOUR_API_KEY
It will return a place ID for postal code 2010: ChIJ3QyubXuuEmsREIe6P2t9ARw
And you can use geocoding with place ID to get required information
https://maps.googleapis.com/maps/api/geocode/json?place_id=ChIJ3QyubXuuEmsREIe6P2t9ARw&key=YOUR_API_KEY
I hope this helps!
I experienced a similar issue periodically, when geocoding US zip-codes. Appending the country name after the zip-code seemed to fix the problem. So, instead of 60162 use 60162 USA.
When a URL is opened in the browser based on its IP context, it identifies the country and automatically deduces the query format for a zip code is 99.999-99.
The format above is for Brazil, but there are different standards for each country such as USA and Portugal.
One solution when calling an API via CURL, either by code or by terminal, include the "&components = country: US" parameter, changing the "US" country code to what you want to filter.
The Google API returns ZERO_RESULTS for safety, because a search would be too slow and could do a global search worldwide and not just the country. For performance and speed reasons, Google creates this automatic ID for help, but unfortunately is not provided to developers about this process.
Good luck!
When I try to geocode one of the adress using Google geocode api, Google api returns an incorrect location.
search address : republic of estonia
result from google api: spain
I am using javascript Google api to geocode the address. For some other location the result is correct but for above address its incorrect.
If we enter below url in browser, we get the JSON back and it is showing result somewhere in Spain rather than showing result in Estonia.
http://maps.googleapis.com/maps/api/geocode/json?address=republic%20of%20estonia
I tried same addres in maps.google.com and it takes me to correct location.
Have a look at the Estonia country feature in Map Maker:
https://www.google.com/mapmaker?iwloc=0_0&fmi=0_0&gw=39&fid=5085290329182063613:4677726785527621059&dtab=overview&ll=58.620408,24.93212&spn=3.101226,8.668213&z=7&lyt=large_map_v3&htll=58.560236,25.449737&hyaw=278.7642140009582
If you check the list of names for this feature, you will see that there is no 'Republic of Estonia' in the list. The name is simply 'Estonia'.
The request for 'Estonia' works as expected:
https://maps.googleapis.com/maps/api/geocode/json?address=estonia&key=YOUR_API_KEY
If you believe that 'Republic of Estonia' must be in the list of the names please Send a feedback (bottom right corner) to Google from this page
https://www.google.com/maps/place/Estonia/#58.7223142,23.1414399,7z/data=!4m5!3m4!1s0x4692949c82a04bfd:0x40ea9fba4fb425c3!8m2!3d58.595272!4d25.013607?hl=en
Google assumed you were looking for "Calle Estonia" or "Estonia Street".
You should request that Google add "Republic of Estonia" to their list of spaces. Google, and most other mapping services, only have "Estonia" or "EST" in their list of places.
Also, you may want to use a different API if you need to get an accurate answer. Google is really good, but Google tries to "guess" what you mean and always gives you a result. But, a service like SmartyStreets matches searches to databases of addresses (so if the search is not a "real" place, it will tell you).
(Full disclosure: I have worked for SmartyStreets.)
This is weird. When I search something like "The New York Palace Hotel,America,New York" in Google maps app's search box I get exactly the hotel on the map.
However When I use the maps API,
A GET at http://maps.googleapis.com/maps/api/geocode/json?address=The%20New%20York%20Palace%20Hotel,America,New%20York&sensor=true
I get ZERO results in the response.
It doesn't even give New York as the option in search results.
I am making an app where I use this API to get the lat-long for user provided address.
Now, I don't know why this Google maps API doesn't work the way the Google maps app works.
BUT I wanted to know, is there a way to search and provide Google maps API these search terms as meaningful words where instead of taking whole string as one parameter it knows which city I am searching and which Address I ams searching.
If not, then only option left with me will be to Once the first results fails I make another query for city name only.
recently, i was given a similar task, and came to know the api works reverse... i.e.. we can get address for lat lon that we provide.. and that too has its own restrictions (i.e.. no.of addresses resolved per request, mostly some 2500 address per day something...)....here you can get some info over that...
You are using the Geocoding API. "The New York Palace Hotel,America,New York" is not an address, it is a "place". The Places API might be a better option.
Example of your query using the (javascript version of) the Places API
I am building an application which uses Google Places API to show restaurants near my current location. For some reason the results are very sparse compared to the results that I can see from the Google Places iPhone application. For example from my rural home, Google Places app shows the nearest location 2.4 mi away. The Places API from this lat/long shows the nearest location 15.7 mi away.
Is it possible that "Google Places" the application is not using the Google Places API?
The Google Places App does not use the Google Places API so you will not see the exact same results, however you should see similar results.
A few tips when using the Places API:
The Places API by default sorts returned results in your selected radius by prominence, not distance. If you would like to find the closest places as it sounds like you are trying, use rankby=distance in your query with out the radius parameter.
Try using the keyword parameter instead of the 'name' parameter, as per the documentation: the 'keyword' parameter is matched against all available fields, including but not limited to name, type, and address, as well as customer reviews and other third-party content, this tends to return more results.
If you adhere to these tips you will most likely get similar results to Places App.