Needs work
Project:
Geo
Version:
6.x-1.0-alpha5
Component:
Geo API
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
24 Dec 2009 at 03:24 UTC
Updated:
31 May 2011 at 20:46 UTC
Jump to comment: Most recent file
Comments
Comment #1
phayes commentedAttached is the second patch.
This one adds support for using shapefiles as a parser for feeds. So using this we can import nodes using data from a shapefile. Very very cool.
The second file should be placed at /includes/feeds/
Comment #2
phayes commentedAnd I forgot to include the second file....
Comment #3
phayes commentedOne final note. You'll note that i've replicated some of the functionality of geo_shp2sql . I thought it better to start this patch mainly as an addition to current code, without a lot of modification. If you all think it's a good idea, I will modify this code as well as geo_shp2sql so that there is less duplication.
Comment #4
summit commentedSubscribing, could this also be used for http://drupal.org/project/openlayers ?
greetings, Martijn
Comment #5
phayes commentedOkay. I've rolled this out into a new module: http://drupal.org/project/spatial
This will work for both geo fields and openlayers_wkt fields. So no need to do this in geo anymore.
Comment #6
allie mickaI'm still going to mark this as "needs work" - native feeds integration is still valuable to Geo, but it must be written using the API. Otherwise, resulting data will not be recognized by Views, fields or other relationships. Meanwhile, this parsing is still necessary for geo_data; so why maintain the same code in multiple places?
Thanks!
Comment #7
phayes commentedI had to hack around the shp2sql converter quite a bit to get it to work. But I would like to combine them back into one when I have the time. Had already created an issue for it: http://drupal.org/node/696094
Comment #8
jerdavisI've been meaning to roll this back in as well in some way to get this ball rolling. This makes lat/lon to geo available as a mapping option for feeds
Putting this up here for review/discussion/use/combining in the interim.
Comment #9
phayes commentedBelow is a full file for ready to go for feeds integration. Name to
geo_field.feeds.incand include.Also, i've removed geo fields feeds integration in Spatial Import module, so there will be no conflict.
Comment #10
steinmb commentedVery very useful, but have not yet been able to get it working. I think we need to roll a complete patch against head so it is easier to review and test. I must be missing a few steps:
#9 contain the code that goes in geo/modules/geo_field/geo_field.feeds.inc ?
If this is correct, where is code where we include this function? geo/modules/geo_field/geo_field.module?
Comment #11
phayes commentedsteinmb,
Correct, you just need to do a
module_load_includesomewhere in geo_field.module, likely near the start, and likely wrapped in amodule_existsfunction.Comment #12
jordanderson commentedI just want to make sure I understand what this does. I have a CSV file with data that includes latitude and longitude columns. Will the patch and/or snippet in #9 create a feeds plug-in that will allow me to map those fields to a spatial field?
I included #9 as indicated (I think), but the spatial field is not showing up as a possible target when I set up the import mapping. Do I first need to apply the attached patch(es)?
I have added the spatial module linked in #5 to my site. Maybe I need to remove that to get #9 working?
Thanks.
Comment #13
phayes commentedSomeone needs to re-roll this patch as feeds API has changed a littla bit in the intervening time.
Comment #14
jonathan_hunt commentedHere's a modified version that works for me, but I'm only importing lat and lon. Main change is that geo_value() expects data as an array of lat and lon.
Comment #15
steinmb commentedAh, thanx Jonathan :)
--
Best regards from Norway, not a bad place to Kayak.