Locatio mapper feedapi georss for ckk
I have been looking into the location mapper for the feedapi.
My rss feeds are provided by a affiliate-datafeeds to rss converter. This feed includes categories and georss information. I found the following issues:
- RSS does not have other geo fields except the georss tags
- The location mapper does not allow mapping other fields then the georss (makes sence after the first issue)
- When solving 1 and 2 the locatiomodule will still attempt to find ‘better’ coordinates and throw away the provided onces
- You can only map fields once. Thus using the category from the rss feed mapped to the taxonomy you can’t map to the location module
- The location module will not produce georss information for fields stores in ckk ( and the mapper stores in ckk only)
Problem 1 (and 4 ) was solved by adding non-rss fields to the rss feed, allowing to map by the location module. The rss feed is now invalid; however, the feedapi will parse the fine.
Some datafeeds contain the correct latitude and longitude of the item; I don’t want the location module to interfere. I found the inhibit_geocode fieldd to solve this one. Works together with the patch the add all the location fields the the mapper
Final problem was to put the geo information back into the rss feeds, the required some modifications to the cck and the location module.
Are the any developments on these topics or shall I provide a code diff here to share some thoughts?

the diff
diff -r -w ./cck/content.module ../modules/cck/content.module325a326,340
> * Implementation of hook_nodeapi 'rss item' op.
> * brambring.nl gryla.biz
> * Generate field render arrays.
> */
>
> function content_rss_item(&$node, $teaser = FALSE, $page = FALSE) {
> // Let field modules sanitize their data for output.
>
> // Merge fields.
> $additions = _content_field_invoke('rss item', $node, $teaser, $page);
> return $additions;
> }
>
>
> /**
421a437,446
> /**
> * Implementation of hook_nodeapi 'rss item' op.
> * brambring.nl gryla.biz
> * Generate field render arrays.
> */
>
> if ($op == 'rss item') {
> $ret= $callback($node, $a3, $a4);
> return $ret;
> } else {
433a459
> }
diff -r -w ./feedapi_mapper/mappers/feedapi_mapper_location.inc ../modules/feedapi_mapper/mappers/feedapi_mapper_location.inc
14c14,15
< $sub_fields = array('latitude' => t('Latitude'), 'longitude' => t('Longitude'));
---
> /* fix 1 alle velden */
> $sub_fields = array('latitude' => t('Latitude'), 'longitude' => t('Longitude'), 'name' => t('Location name'), 'street' => t('Street location'), 'additional' => t('Additional'), 'city' => t('City'), 'province' => t('State/Province'), 'postal_code' => t('Postal code'), 'country' => t('Country') );
15a17
>
32a35,38
> /* fix 3 als je lat en lon meegeeeft ( en landeninfo) dan faat de locationmapper je lat en lon verneuken */
> if ( $node->{$field_name}[$i]['latitude']
> && $node->{$field_name}[$i]['longitude'] ) {
> $node->{$field_name}[$i]['inhibit_geocode'] = true;
34a41,45
> } else {
> /* fix 2 de lat en lon worden als array meegegeven, er kunnen meerdere lokaties zijn
> maar dat wordt niet gedaan voor de andere velden */
> $node->{$field_name}[0][$sub_field] = $feed_element;
> }
diff -r -w ./location/contrib/location_cck/location_cck.module ../modules/location/contrib/location_cck/location_cck.module
133a134,140
> /**
> * Implementation of 'rss item' op.
> * brambring.nl gryla.biz
> */
> case 'rss item':
> return location_cck_field_rss_item($op, &$node, $field, &$items, $teaser, $page);
> break;
481a489,514
>
> /**
> * Implementation of 'rss item' op.
> * brambring.nl gryla.biz
> */
>
>
> function location_cck_field_rss_item($op, &$node, $field, &$items, $teaser, $page) {
> $geoitems=array();
> $settings = variable_get('location_settings_node_'. $node->type, array());
> $mode = isset($settings['rss']['mode']) ? $settings['rss']['mode'] : 'simple';
> if ($mode == 'none') {
> return;
> }
>
> $fields = array();
> foreach ($items as $location) {
> if (location_has_coordinates($location) ) {
> $location['source']=1;
> if (($item = location_rss_item($location, $mode))) {
> $geoitems[] = $item;
> }
> }
> }
> return $geoitems;
> }