I have several sites using the location module with geocoding enabled to populate the lat long based on the address fields entered. These include Drupal 6 and 7 sites with varying versions of the module.

Geocoding from Google for the UK seems to have stopped working on all of them recently.

Has anyone else had this problem?

Comments

Wouter Van den Bosch’s picture

Same issues with 2 sites that haven't had their code changed in a while.

As of today (might be yesterday) geocoding (in Belgium) returns a latitude of 180, resulting in a database error upon saving the values.

Nothing was changes on these sites in the past weeks.

I updated my API keys just to be sure, but to no avail.

crystaldawn’s picture

Version: 7.x-3.0-rc1 » 7.x-3.x-dev
Component: Miscellaneous » Code
Category: support » bug
Priority: Normal » Critical

It appears that the patches in the D6 version never made it to the D7 branch or they were removed for whatever reason. The following can still be found in the google.inc file:

 $url = url('http://maps.google.com/maps/geo', array(
    'query' => $query,
    'external' => TRUE,
  ));

This is the WRONG url to be using as defined here:
https://developers.google.com/maps/documentation/geocoding/?hl=fr

Geocoding Requests

A Geocoding API request must be of the following form:

http://maps.googleapis.com/maps/api/geocode/output?parameters
where output may be either of the following values:

json (recommended) indicates output in JavaScript Object Notation (JSON)
xml indicates output as XML
To access the Geocoding API over HTTPS, use:

https://maps.googleapis.com/maps/api/geocode/output?parameters
HTTPS is recommended for applications that include sensitive user data, such as a user's location, in requests.

In either case, certain parameters are required while some are optional. As is standard in URLs, all parameters are separated using the ampersand (&) character. The list of parameters and their possible values are enumerated below.

Required parameters

address — The address that you want to geocode.
or
latlng — The textual latitude/longitude value for which you wish to obtain the closest, human-readable address. See Reverse Geocoding for more information.
or
components — A component filter for which you wish to obtain a geocode. See Component Filtering for more information. The components filter will also be accepted as an optional parameter if an address is provided.
sensor — Indicates whether or not the geocoding request comes from a device with a location sensor. This value must be either true or false.

This is a major bug making the geocoding capabilities completely useless. It's like a car without wheels. The engine is on, but you're not going to be going anywhere anytime soon lol. Thus, the URL and the parameters need to be updated as soon as possible.

UPDATE: I just checked the latest stable and dev release manually, and this appears to be fixed. I dont know why but when I used drush to do the DL, it was not getting a version with these fixes. I had to DL these manually without using drush. Thats a headscratcher, what would cause that?

crystaldawn’s picture

Status: Active » Closed (fixed)

Appears to be fixed, could be a possible drush issue though. IDK.

iancawthorne’s picture

Title: Geocoding stopped working? » Geocoding stopped when a "State" is specified?
Version: 7.x-3.x-dev » 6.x-3.3
Status: Closed (fixed) » Active

I've re opened this with some more specific details I've just discovered today as this does not appear to be fixed in my case.

With the latest Drupal 6 release (3.3), if a "State" (or County as I'm in the UK) is specified, Geo coding is lost. Removing the value in the State field and the geo coding works fine.

I'm not sure why this would be the case when a) the chosen state is correct and b) In the geo coding options, I've set to zip code accuracy, so the state would be ignored in this scenario?

legolasbo’s picture

Issue summary: View changes
Status: Active » Closed (outdated)

Closing old D6 issues as D6 is end of life