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:

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.

Comments

pol’s picture

Status: Needs review » Needs work

This 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.

basvredeling’s picture

Would it be acceptable to log the debug info to watchdog log instead? Or just dump it to watchdog if devel is not available?

pol’s picture

Hi,

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.

basvredeling’s picture

Title: Add debugging mode » Force re-encoding of already geocoded data
Issue summary: View changes
Status: Needs work » Needs review
Related issues: -#2123403: Avoid the display of google geocoding errors to user, instead sent it to watchdog., -#1617876: Give an option to not show geocoding error messages +#1928280: Geocode existing nodes
StatusFileSize
new1.7 KB

I 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.

pol’s picture

Status: Needs review » Needs work

Please, can you fix:

+    '#default_value' => variable_get('geocoder_debug', 0),
basvredeling’s picture

Status: Needs work » Needs review
Related issues: +#1493496: When programmatically creating many nodes, 10k+ is there a way to skip geocoding if it has already been geocoded?
StatusFileSize
new1.71 KB

  • basvredeling authored b45099b on 7.x-1.x
    Issue #2514834 by basvredeling: Force re-encoding of already geocoded...
pol’s picture

Status: Needs review » Fixed

Thanks, fixed!

basvredeling’s picture

Thanks, that's really fast! ^^

Status: Fixed » Closed (fixed)

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

basvredeling’s picture

Status: Closed (fixed) » Needs review

@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).

pol’s picture

system_settings_form() calls submit callback system_settings_form_submit.

Looks like the variable set is done in that callback.

basvredeling’s picture

All 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?

$form['geocoder_recode'] = array(
   '#type' => 'checkbox',
   '#title' => t('Force re-geocoding'),
   '#description' => t('Enable forced re-geocoding of all geocoded fields on entity save even if there are no apparent changes.<br/><em>This option can slow down bulk saves and increases the amount of calls to the geocoding service.</em>.'),
   '#default_value' => variable_get('geocoder_recode', 0),
);
pol’s picture

Patch failed to apply.

basvredeling’s picture

StatusFileSize
new930 bytes

Try this patch.

  • Pol committed 9950af3 on 7.x-1.x authored by basvredeling
    Issue #2514834 by basvredeling: Force re-encoding of already geocoded...

  • Pol committed b12cfc5 on 7.x-1.x authored by basvredeling
    Issue #2514834 by basvredeling: Force re-encoding of already geocoded...
  • Pol committed e54dd09 on 7.x-1.x authored by basvredeling
    Issue #2514834 by basvredeling: Force re-encoding of already geocoded...
pol’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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