I am trying to import a feed in which a location is provided by the RSS feed as an array including latitude and longitude. My issue is similar to this one: http://drupal.org/node/371288. After creating the Feed, and am then taken to the new feed, I click on Map. Here's the example feed for how the location is coming in:

            [location] => Array
                (
                    [latitude] => Array
                        (
                            [0] => 47.67334
                        )

                    [longitude] => Array
                        (
                            [0] => -117.41027
                        )

                )

I am using this in conjunction with the Location module and CCK. I tried adding a field "Longitude" and "Latitude" and then tried mapping Options->Location->Latitude and Options->Location->Longitude to these fields. That didn't work, and the very next time I tried to create the feed, I got the following fatal error (I took out all identifying information):

Fatal error: Cannot use string offset as an array in sites/all/modules/location/contrib/location_cck/location_cck.module on line 348
array(4) { ["type"]=> int(1) ["message"]=> string(36) "Cannot use string offset as an array" ["file"]=> string(111) "/sites/all/modules/location/contrib/location_cck/location_cck.module" ["line"]=> int(348) } n/a

Any help or suggestions would be appreciated.

Comments

DavidWhite’s picture

Title: Mapping a location latitude and longitude » Clarification

When I received that Fatal Error, that was the very next time that I tried to Refresh the feed, and not when I actually created it.

DavidWhite’s picture

Title: Clarification » Mapping a location latitude and longitude

Fixed the title. Sorry guys, still trying to get used to this thing - this is the first issue I've ever created over here.

DavidWhite’s picture

This is still an issue for me that I am working to try and resolve. I have studied the past few weeks how modules work, and have dug into the source code of the available mappers, as I was thinking about building my own mapper.

I have a content type "Jobs Import," and I am creating a new node using FeedAPI when a job is imported. On the mapping page, I see "Description of Available Mappers" and the only mapper I see available is node module. I guess this makes sense, as I am mapping this thing to a node. So I checked the code in feedapi_mapper_node.inc and I see that it doesn't do anything with location like location module does.

So should I be going about this differently? My content type "jobs import" creates a new node "Documents" which is a Page.

- David

DavidWhite’s picture

For more clarification, our system has CCK module installed as well as Location module installed. As mentioned before, I tried mapping to a location provided by CCK's structure, and after creating a field called "longitude" and a field called "latitude," I got the fatal error mentioned above.

When I try to use the built-in way of doing this (i.e. when I am editing the content type, and instead of creating a field, I edit the Locative information), I don't have a way of mapping the longitude and latitude.

Any ideas or suggestions or help would be appreciated.

DavidWhite’s picture

*UPDATE*

I have now created 1 CCK-Field type "Location" that I have named "location," and I am able to map to it successfully. However, when I go to Feed Items, the location is reported as the country (United States) rather than the city. I am only given the coordinate points in the feed, and it doesn't provide me with an address, city, etc... Is there anyway that I can translate the latitude / longitude INTO a city?

- David

DavidWhite’s picture

Status: Active » Fixed

Evan from #495690: Change user-inputted address (or lat/lon) to geocoded address info helped me work on the issue we've been having as we are in the same office. His patch, comment #6, resolves this issue.

Status: Fixed » Closed (fixed)

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