I had a use for Google geocoding with an accuracy below 3 (specifically, 2). Previous issues show this accuracy minimum has already been lowered, but not everyone has a use for less accurate geocoding, so rather than lowering it again, I suggest making it a variable, editable via the Google geocoding configuration form. The attached patch does this.

Comments

sreynen’s picture

This continues to need review.

pingers’s picture

I probably should of started with this patch... mine looks similar.

It provides google maps api accuracy settings on a per country level.

Very handy for the project I was working on :)

sreynen’s picture

A combination of the two would be good, so we can have a default accuracy, and then override that per-country.

yesct’s picture

Issue tags: +location geo-coding

yes, could someone review the first patch?
http://drupal.org/patch/review

Maybe it could be committed, then work on a patch to do per country settings based on that one?

yesct’s picture

just to clarify, how is this issue different than #747192: precision and scale of locations
?

hutch’s picture

It would appear that there *is* a demand for reduced accuracy, I'm a bit surprised but there you have it.

I will review these two patches in the next day or so.

Requirements are (as I understand it):
An overall setting of 1 to 6
A country specific setting of 1 to 6
Both in location configuration form.

It's worth a look at anyway.

hutch’s picture

Assigned: Unassigned » hutch
StatusFileSize
new5.08 KB

I have been over these two patches and found that what they actually do is not reduce accuracy but set a minimum accuracy that will be accepted from Google. That makes a lot more sense.

I have reworked them (patch attached) so that there is a default minimum that can be set under admin/settings/location/geocoding and a per-country setting under the 'Configure parameters' settings. The existing default of '3' remains so nothing changes unless you change it and save configuration.

The files altered by this patch are geocoding/google.inc, location.admin.inc and location.module

Everything seems to be working but it would be good if others could test this, particularly the original posters of the patches.

hutch’s picture

StatusFileSize
new5.08 KB

location_accuracy_both.patch has a bug in it, use this one instead, sorry, my bad ;-(

rooby’s picture

Status: Needs review » Fixed

Committed - http://drupal.org/cvs?commit=372036
[EDIT] Using the patch from #8, thanks to all for the patches.

I changed the country specific variable names to be:
location_geocode_<countrycode>_google_accuracy_code
so it is in line with the existing variables such as:
location_geocode_<countrycode>_google_apikey

Also, I added the country accuracy setting to location_geocode_au_google_settings() in location.au.inc.
Australia is currently the only country to implement it's own settings form.

As a side note, I don't see any reason for location.au.inc to implement it's own geocode settings form that is the same as the default one.
- See #810840: Remove location_geocode_au_google_settings from location.au.inc (location.xx.inc)

rooby’s picture

rooby’s picture

Committed to DRUPAL-5--3 - http://drupal.org/cvs?commit=372126

Status: Fixed » Closed (fixed)
Issue tags: -location geo-coding

Automatically closed -- issue fixed for 2 weeks with no activity.