How to import latitude and longitude pairs as Geofield?

Created on 16 January 2021, about 4 years ago
Updated 5 February 2025, about 1 month ago

Hello,

I am trying to import into https://www.drupal.org/project/geofield setup with latitude and longitude input.

Looks like some custom php magic will be needed to get it to work. Any tips if there is a hook somewhere I could use? https://www.drupal.org/project/geofield/issues/2708529

I tried playing with my CSV like this, but no luck. Any tips how to proceed?

field_geonames_id,title,title2,,field_geofield|lat,field_geofield|lon,P,PPL,AD,,02,,,,field_geonames_population,,1832,field_geonames_timezone,2017-11-06
3038999,Soldeu,Soldeu,,42.57688,1.66769,P,PPL,AD,,02,,,,602,,1832,Europe/Andorra,2017-11-06
3039154,El Tarter,El Tarter,"Ehl Tarter,Эл Тартер",42.57952,1.65362,P,PPL,AD,,02,,,,1052,,1721,Europe/Andorra,2012-11-03
Feature request
Status

Active

Version

1.0

Component

Code

Created by

🇭🇺Hungary giorgio79

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇪🇸Spain qpro Spain

    At least in my environment (Drupal 10 and CSV Importer 8.x-2.0) , WKT its the unique format that works,
    so if your field name is "field_geolocation" this is your column name in the CSV file,
    and coordinates goes like
    POINT (-8.353240013 43.32009888)

Production build 0.71.5 2024