After content is saved, the Geocoding Rule Set is scheduled - this is to be certainthe address source field is fully populated before geocoding, not sure it is necessary. In testing, the WKT Field does not get populated.

Source Text Field: full street address

Destination OL WKT Field: Same OL WKT field currently used. For Widget Type, tried both OL Hidden Value and OL Geocoder. Would prefer to use OL Geocoder just in case the address needs to be manually modified.

It seems easy and simple, but the WKT Field is never populated.

Wondering if something is wrong and how others are using it to work. Thanks.

Comments

itserich’s picture

Title: Can Not Get Geocoding - Any Recipes? » Unable to Get Simple Sample To Work - Any working examples?

I created a simple sample content with two fields: 1- text area 2- OpenLayers WKT

Then I created two Rules, one triggered when the content type is created and one when it is updated.

Condition- Content type

Action is to geocode:
Content- created content
Source Text- newly created text area
Destination - Geocoded Location

There is never any geocoding. When I remove the triggers, there is still no geocoding.

On my site, and I think on many sites, this would be a useful feature.

Perhaps it is a conflict with another module, I have many enabled. There are no watchdog errors. Perhaps it is due to a change within Openlayers.

If anyone has this working and could post the Content Type export and Rule export or tell me what might be wrong I would appreciate it.

itserich’s picture

Version: 6.x-1.x-dev » 6.x-1.0
henrrrik’s picture

Here's an exported rule from a site with a working setup:

array (
  'rules' => 
  array (
    'rules_2' => 
    array (
      '#type' => 'rule',
      '#set' => 'event_node_presave',
      '#label' => 'Geocode Exhibition content',
      '#active' => 1,
      '#weight' => '0',
      '#categories' => 
      array (
      ),
      '#status' => 'custom',
      '#conditions' => 
      array (
        0 => 
        array (
          '#type' => 'condition',
          '#settings' => 
          array (
            'type' => 
            array (
              'exhibitor' => 'exhibitor',
            ),
            '#argument map' => 
            array (
              'node' => 'node',
            ),
          ),
          '#name' => 'rules_condition_content_is_type',
          '#info' => 
          array (
            'label' => 'Saved content is Exhibition',
            'arguments' => 
            array (
              'node' => 
              array (
                'type' => 'node',
                'label' => 'Content',
              ),
            ),
            'module' => 'Node',
          ),
          '#weight' => 0,
        ),
      ),
      '#actions' => 
      array (
        0 => 
        array (
          '#weight' => 0,
          '#info' => 
          array (
            'label' => 'Geocode a field or a combination of fields',
            'arguments' => 
            array (
              'node' => 
              array (
                'type' => 'node',
                'label' => 'Content',
              ),
            ),
            'module' => 'Rules Geocoder',
          ),
          '#name' => 'rules_geocoder_action_geocode_fields',
          '#settings' => 
          array (
            'sources' => 
            array (
              'field_street_address' => 'field_street_address',
              'field_exhibition_zip' => 'field_exhibition_zip',
              'field_city' => 'field_city',
            ),
            'destination' => 'field_exhibition_geolocation',
            'prefix' => '',
            'suffix' => ', sweden',
            '#argument map' => 
            array (
              'node' => 'node',
            ),
          ),
          '#type' => 'action',
        ),
      ),
      '#version' => 6003,
    ),
  ),
)

itserich’s picture

Thank you @ henrrrik on

This Rule works fine. Thanks so much, this is a big help.

It appears to not work if the EVENT is changed from "Content is going to be saved" to "After updating existing content" which is what I was originally using.

Has anyone got Rules Geocoder workig with an event Other Than "Content is going to be saved"

itserich’s picture

Title: Unable to Get Simple Sample To Work - Any working examples? » Does Not Geocode Node if Event = "After Updating Existing Content" - Works with Event "Content is going to be saved"

So I have done more testing with Rules Geocoder and for some reason the geocoding is not working if the trigger Event = After updating existing content.

I tried different weights for the Triggered Rule -10, 0, 10.

Tried to update the title instead of the geocoded field several times in a row, but no geocoding.

This is the result using Debug rule evaluation.


13.508 ms Executing the rule "Rule Geocoder - Updated Content Test" on rule set "After updating existing content"
 13.726 ms Condition "Updated content is rule_geocoder" evaluated to TRUE.
 13.908 ms Action execution: "Geocode a field or a combination of fields"
 99.952 ms Evaluation of "After updating existing content" has been finished.
 
rule_geocoder test 2 has been updated.

Using Event trigger Content is going to be saved has worked each time in my few tests.

Am going to try other situations such as Rule Sets, conditions, etc.

Curious if anyone else has found situations which do work and do not work. I think this is an important module if it can work with Views Bulk Operations and so on.