1

I'm a french developer and I have question about GMAP Geocoding API. I'm on a new website work, which use this API.

The Geocoding API is used to get geocoded boundaries of french cities when user enter a french postal code. So I request the API by this URL : https://maps.googleapis.com/maps/api/geocode/json?address=MY_ZIP_CODE&components=country:fr&key=my_key

In France, sometimes there is multiple cities for one postal code. The default city is written in the JSON in address_components, "types" : [ "locality", "political" ] and all the cities are writtent in "postcode_localities". (have an example in screenshot).

Last week, everything was working good. But today, I've got a big probleme... When I use postal code (69510, 69310, 69600, etc....) multiple cities or alone city aren't no longer displayed.... But it works good for "69530".

It's embarassing for me because the website I'm bulding use the postal code to do a geolocated search with km radius...

Do you know if this API was update ?

I've search on Google.... But I've never find an answer.

Thanks in advance for your help !!

Have a nice day

My screenshot that show the API JSON answer

  • Yeah, so the order of the address components can be different; I think that causes your problem. Check out if my function helps, let me know http://stackoverflow.com/questions/27203977/google-api-address-components/27226620#27226620 – Emmanuel Delay Dec 13 '16 at 17:10
  • The Geocoding API was updated recently, you can find announce in the [geodev blog post](https://googlegeodevelopers.blogspot.com.es/2016/11/address-geocoding-in-google-maps-apis.html). Probably, it's worth filing issue in the [public issue tracker](https://code.google.com/p/gmaps-api-issues/). – xomena Dec 13 '16 at 20:36

4 Answers4

1

I was experiencing this problem as well yesterday. @xomena was right.

They updated their API at the end of November/beginning of December, and started more strictly encouraging best practices – using the Geocoding API for complete postal code strings (for example, “48 Pirrama Rd, Pyrmont, NSW, Australia”), and the Places API for more ambiguous addresses and semantic locations, including businesses and points of interest.

Specifically their blog post said:

Future Changes to Geocoding API

We plan to roll out an update to the Geocoding API at the end of November 2016 that will increase the difference between Geocoding and Places performance for ambiguous and unambiguous queries. This change will improve the quality of Geocoding results for unambiguous queries, but will be more likely to return ZERO_RESULTS for ambiguous or incomplete queries where the Geocoding API was unable to find a high quality result.

If you are already using the above best practices, you should see an improvement in your Geocoding API results. If you are currently using the Geocoding API for incomplete or ambiguous queries, or for queries that may contain non-address information such as business names or apartment numbers, we recommend that you switch to the Places API instead, as it is likely to give better quality results for your use case.

Try using the Place Search API instead! https://developers.google.com/places/web-service/search

Community
  • 1
  • 1
ericodes
  • 790
  • 5
  • 6
1

Please file a bug in the Google Maps API issue tracker.

This is not related to the new geocoder, you'll see that adding new_forward_geocoder=false to your requests makes no difference.

The postcode_localities field is never exposed in Places API.

miguev
  • 4,481
  • 21
  • 41
0

I am experiencing the same problem as described by @Jean-Baptiste. I opened an issue : http://code.google.com/p/gmaps-api-issues/issues/detail?id=11087

Mehdi
  • 1
  • 1
0

Thanks for your answers. That's true, the Places API can't give an autocompletion and the Autocomplete API doesn't give me satisfaction.

I've change my JS API parser and I get geocoding datas even if the postcode localities exists. If the zip code exists, so the geocoding datas exist. That's a solution.... The visitor knows the zip code of the city where he lives. And for a major part of cities, the zip code is ok.

I saw that www.booking.com has the same problem... Screenshot of the same problem on booking.com

That's solved for me ;-)

Thanks !!