Google don't give exactly the same structure if you give an addresses or just a city...
But all have a city so geocode need to feed $this->city
It's kind of late for me but watch the patch...
| Comment | File | Size | Author |
|---|---|---|---|
| geocode.inc_city_also_without_adresse.diff | 740 bytes | gagarine |
Comments
Comment #1
gagarine commentedComment #2
mr.baileysI think the root of the problem is the fact that Google's response is inconsistent, sometimes wrapping the Locality in SubAdministrativeArea, sometimes putting it directly under AdministrativeArea. It does not only occur when just requesting cities (without addresses), but seems to occur for some addresses too.
The patch attached does not address the full scope of the issue: if SubAdministrativeArea is present, the entire Locality is found underneath, including for example "street1" and "zip". The patch only addresses "LocalityName".
As the root cause is the same as #730758: geocode_google handler seems to leave out Locality data and that issue contains a fix that should address all scenarios, I'm marking this one as a duplicate.