Currently, geocoded values are cached. An geocoded field cannot be re-coded while the cache persists. There are instances in which you might want to force re-geoencoding:
- stale or very old data
- programmatic and bulk updates (VBO)
- address-field reconfigurations (for instance: added postal code field, or another addressfield property that might influence geocoding accuracy)
- address changes in the geocoder service (company X moved to a new address and we need to refetch the geodata from the service)
- updates from data saved with older versions of geocoder (for instance: #2305043: Geocoder ignores organization and sub_premise from addressfield or #1871962: Use Countries module to improve geocoding results)
I've added a patch to add a solution with a simple geocoder variable, editable in the geocoder config form.
It allows forced re-encoding of all existing fields (on entity save) by bypassing the cached data.
| Comment | File | Size | Author |
|---|---|---|---|
| #15 | geocoder-force_re_encoding-2514834-15.patch | 930 bytes | basvredeling |
| #6 | geocoder-2514834-6.patch | 1.71 KB | basvredeling |
Comments
Comment #1
polThis would add a new dependency to the devel module, and I'm a bit against that, so nope, we have to find a better way to debug.
Comment #2
basvredelingWould it be acceptable to log the debug info to watchdog log instead? Or just dump it to watchdog if devel is not available?
Comment #3
polHi,
I think dumping to watchdog is the best option.
I cannot make devel a dependency of the module.
I still don't know what is the best method for implementing such behavior.
Comment #4
basvredelingI changed the scope of this issue. It only deals with regeocoding of existing data. I removed the "debugging output" and devel references. Geocoding service exceptions are already logged to watchdog, so that's not really relevant. Issue summary and title are updated as well.
Here's another patch which simply adds a variable to the module config page and which allows you to bypass cached geocoding results.
Comment #5
polPlease, can you fix:
Comment #6
basvredelingComment #8
polThanks, fixed!
Comment #9
basvredelingThanks, that's really fast! ^^
Comment #11
basvredeling@pol The variable check is in the current code, but the system setting form part in geocode.admin.inc isn't. Is this intentional? Regular users now have no means to enable this recoding, nor is it documented as a developer option (by setting it through drush for example).
Comment #12
polsystem_settings_form() calls submit callback system_settings_form_submit.
Looks like the variable set is done in that callback.
Comment #13
basvredelingAll I'm saying is: this part of my patch is not in the current codebase. So there's no checkbox in the geocoder settings form to enable / disable this variable. Is this intentional?
Comment #14
polPatch failed to apply.
Comment #15
basvredelingTry this patch.
Comment #18
pol