Closed ahmed-bhs closed 4 years ago
Hello @ahmed-bhs,
Could you give use the raw response from Google Maps API (so we can compare and detect where the issue exactly is) ?
Hey @jbelien thank for your answer, ther's is it :
{
"results" : [
{
"address_components" : [
{
"long_name" : "17000",
"short_name" : "17000",
"types" : [ "postal_code" ]
},
{
"long_name" : "Nouvelle-Aquitaine",
"short_name" : "Nouvelle-Aquitaine",
"types" : [ "administrative_area_level_1", "political" ]
},
{
"long_name" : "France",
"short_name" : "FR",
"types" : [ "country", "political" ]
}
],
"formatted_address" : "17000, France",
"geometry" : {
"bounds" : {
"northeast" : {
"lat" : 46.19100040000001,
"lng" : -1.1113177
},
"southwest" : {
"lat" : 46.1331208,
"lng" : -1.2417438
}
},
"location" : {
"lat" : 46.1600767,
"lng" : -1.1774721
},
"location_type" : "APPROXIMATE",
"viewport" : {
"northeast" : {
"lat" : 46.19100040000001,
"lng" : -1.1113177
},
"southwest" : {
"lat" : 46.1331208,
"lng" : -1.2417438
}
}
},
"place_id" : "ChIJdT0lyYNTAUgRsFiFqpXTBRw",
"types" : [ "postal_code" ]
}
],
"status" : "OK"
}
This is my get http url: https://maps.googleapis.com/maps/api/geocode/json?address=17000,%20France&key=API_KEY
Thanks!
As you can see, there is no mention of "La Rochelle" in Google Maps API response. We can, of course, only extract what the API returns.
@jbelien just for curiosity, do you have any idea why google map does not return city name for some zipcodes ?
@ahmed-bhs Unfortunately, no, I have no idea.
This is really weird, I'm using https://github.com/geocoder-php/Geocoder library, and unfortunately I'm not getting the city name for a zip code equal to 17000. I'm supposed to get "La Rochelle" as city. This is my source code:
This a dump of the result I'm getting:
By the way the city name should be stored under Locality proprity. Any help would be appreciated.