We've been migrating from Drupal 6 nodes using Location module to Drupal 7 nodes using Geofield fields with latitude and longitude. To do this we needed to alter the geofield.inc to allow multiple value subfields with migrate 2.4.
I'll attach a patch of how this is working for us.

CommentFileSizeAuthor
#1 geofield-migration-1702002.patch5.04 KBfinn lewis

Comments

finn lewis’s picture

Status: Active » Needs review
StatusFileSize
new5.04 KB

Attached patch against current dev.
I've only tested this for migrating longitudes and latitudes in to a multi-value Geofield and it appears to be working fine for this use case.
I'm just starting to get my head around extending the MigrateFieldHandler class - any pointers welcome.

finn lewis’s picture

Project: Migrate » Migrate Extras
Component: Code » Geofield

I think I posted this in the wrong queue - sorry!

mikeryan’s picture

Status: Needs review » Needs work

The subfield support is nice, thanks. As for assigning the values, I'd like to see it more compact:

foreach ($arguments as $subfield_name => $subfield_value) {
  if (!is_array($arguments[$subfield_name])) {
    $item[$subfield_name] = $subfield_value;
  }
  elseif (isset($arguments['geo_type'][$delta])) {
    $item[$subfield_name] = $subfield_value[$delta];
  }
}

I don't have anything to test against, so I'll leave that to you...