import csv file to geofield

Events happening in the community are now at Drupal community events on www.drupal.org.
Posted by leofishman on December 4, 2013 at 4:36pm

Hi,

I have to import information in a csv with poligones information to node with a geofield field.

I have tried feeds import and gdal, but gdal doesn't recognize the kml field.

A sample file with 3 records is attached.

Can anyone help me with feeds or with a migrate module?

Thanks,
leo

Edition:

I imported the kml data to a text field and extracted the information with geofield from another field!
I uploaded the module and the image of the secciones content type
for this to work, you need migrate_extras module

AttachmentSize
test.csv 13.19 KB
content_type_secciones.png 39.66 KB
migrate_kml.gz 1.2 KB

Comments

Hi Leo, To import geospatial

Posted by azuledu on December 4, 2013 at 4:59pm

Hi Leo,

To import geospatial data stored in a KML field from a CSV file, you can use Feeds+PostGIS modules (GDAL is not necessary).

As is explained in the GDAL documentation (https://drupal.org/node/2133129) the GDAL module only knows how to work with OGR vector formats (http://www.gdal.org/ogr/ogr_formats.html). The CSV value format only works with WKT (http://www.gdal.org/ogr/drv_csv.html)

I'm not sure if this helps you..

I can't install postGIS

Posted by leofishman on December 4, 2013 at 7:49pm

I can't install postGIS server or postgress.

Thanks

Migrate Extras

Posted by leofishman on December 5, 2013 at 7:08pm

Finally I made a migrate custom module, I had a text field to store the KML and then a geofield Geocode from another field and worked like a charm!

Good! Is it possible to

Posted by azuledu on December 6, 2013 at 8:40am

Good!
Is it possible to contribute it to Drupal in some way? Maybe some code to Geofield module or some HowTo in the documentation.

I uploaded my module to the original post

Posted by leofishman on December 20, 2013 at 12:43pm

Sorry for the delay, just saw this message.

I uploaded the module, an image of the secciones content type and the original csv used to import.

I could import it to a text field named field_kkk and then the field_kml_secciones geocode from that field!

Location and Mapping

Group organizers

Group categories

Wiki type

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

AltStyle によって変換されたページ (->オリジナル) /