I know, I know.. But it's handy....

Here we go: geocode_widget.module
Line 13: 'field types' => array('geo','openlayers_wkt'),
Line 93:

              $column = $form['#field_info'][$field]['type'];
              $values[$delta][$column] = $geo;
CommentFileSizeAuthor
#3 geocode-openlayers_wkt-853190-3.patch3.74 KBagileware

Comments

phayes’s picture

My apologies, error above.

Line 93:

$column = $element['#columns'][0];
$values[$delta][$column] = $geo;
phayes’s picture

Status: Active » Needs review
agileware’s picture

StatusFileSize
new3.74 KB

I also need this functionality.

Here is what I currently have, which from my testing works but isn't feature complete yet.

It gives the openlayers_wkt field type a new widget "Geocoded value from another field".
Unlike the other "Geocoded value from another field" widgets, this one is not hidden as it allows users to modify uploaded data with the openlayers map.

Things that I think should also be addressed are (at least):

  1. Have an option to have the widget hidden like the other "Geocoded value from another field" widgets, but still use the openlayers map for the field formatter for node viewing.
    I have not tested the code in your posts but if that code achieves this functionality maybe it would be good to merge the two approaches to give a hidden widget option and an openlayers map widget option.
  2. Process the file with ajax when it is uploaded instead of on node save. This would allow users to upload a file and then modify the data using the openlayers map then save the node all in one process. Instead of having to upload the file then save the node then edit the node and edit the uploaded data using the openlayers map.

Note: Editing the uploaded data using the openlayers map will currently not work because when you save the node the filefield file is processed again, overriding any changes you have made.
This is addressed in my patch at #973994: Filefield uploads are processed on every node save

itserich’s picture

Would this allow for the transfer of data from a cck field to import into a OL WKT field?

I need to allow users to enter addresses using rigid cck field addresses and would like to transfer it to a WKT field for output.

Does this do that?

If it does, any installation instructions appreciated. This patch looks different from others I have seen but I am not good at patching in any case. Thank you.

itserich’s picture

Figured out Openlayers Geocoder meets my needs.

agileware’s picture

Yeah, this one is basically for uploading a gpx file via filefield and goecode into an openlayers WKT field.

- Although I'm not 100% sure that that was the intention of the original poster or not so my patch might belong in a separate issue.

itserich’s picture

Upon disabling Geocode, I think it is what enabled OL Geocode to do what I want, so apparently it was working. And is working.

So thanks phayes.

For anyone else, what the patch does is allow OL WKT to use text from a prior cck field. It appears to take just one line of text although more can be checked.

This small snippet of code will save numerous hours. Thanks.

itserich’s picture

I am importing thousands of nodes via Feeds module and it appears the WKT which is populated by Geocode is not populated until the node is re-saved again.

I have tried VBO and Rules with functions such as publish, unpublish, node convert, field populate, with no effect. The WKT will not display until the node is simply resaved.

If anyone can help with a php snippet or other idea I would appreciate it. This is key to my project. Thank you.

Edit It appears that when importing, the logical approach is to geocode prior to import. Lots of spreadsheet applications.