Hello,

I have a 'Geofield' in one of my content type. This field comes with lat,long text boxes. I used 'Feeds' module to upload bulk data. But as 'Feeds' don't support contributed field type when mapping, I used 'hook_feeds_presave' to insert values in db table. Still the 'Lat' and 'Long' text fields are not populated.

My code:

function feeds_custom_feeds_presave(FeedsSource $source, $entity, $item, $entity_id) {
$entity->field_customer_coordinates['und']['0']['geo_type'] = 'point';
$entity->field_customer_coordinates['und']['0']['geo_lat'] = $item['Lat'];
$entity->field_customer_coordinates['und']['0']['geo_lon'] = $item['Long'];
$entity->field_customer_coordinates['und']['0']['geo_left'] = $item['Long'];
$entity->field_customer_coordinates['und']['0']['geo_top'] = $item['Lat'];
$entity->field_customer_coordinates['und']['0']['geo_right'] = $item['Long'];
$entity->field_customer_coordinates['und']['0']['geo_bottom'] = $item['Lat'];
}

My field name is 'field_customer_coordinates'. Table name is 'field_data_field_customer_coordinates'.

CREATE TABLE IF NOT EXISTS `field_data_field_customer_coordinates` (
`entity_type` varchar(128) NOT NULL DEFAULT '' COMMENT 'The entity type this data is attached to',
`bundle` varchar(128) NOT NULL DEFAULT '' COMMENT 'The field instance bundle to which this row belongs, used when deleting a field instance',
`deleted` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'A boolean indicating whether this data item has been deleted',
`entity_id` int(10) unsigned NOT NULL COMMENT 'The entity id this data is attached to',
`revision_id` int(10) unsigned DEFAULT NULL COMMENT 'The entity revision id this data is attached to, or NULL if the entity type is not versioned',
`language` varchar(32) NOT NULL DEFAULT '' COMMENT 'The language for this data item.',
`delta` int(10) unsigned NOT NULL COMMENT 'The sequence number for this data item, used for multi-value fields',
`field_customer_coordinates_geom` longblob,
`field_customer_coordinates_geo_type` varchar(64) DEFAULT '',
`field_customer_coordinates_lat` decimal(18,12) DEFAULT NULL,
`field_customer_coordinates_lon` decimal(18,12) DEFAULT NULL,
`field_customer_coordinates_left` decimal(18,12) DEFAULT NULL,
`field_customer_coordinates_top` decimal(18,12) DEFAULT NULL,
`field_customer_coordinates_right` decimal(18,12) DEFAULT NULL,
`field_customer_coordinates_bottom` decimal(18,12) DEFAULT NULL,
`field_customer_coordinates_geohash` varchar(16) DEFAULT NULL,
PRIMARY KEY (`entity_type`,`entity_id`,`deleted`,`delta`,`language`),
KEY `entity_type` (`entity_type`),
KEY `bundle` (`bundle`),
KEY `deleted` (`deleted`),
KEY `entity_id` (`entity_id`),
KEY `revision_id` (`revision_id`),
KEY `language` (`language`),
KEY `field_customer_coordinates_lat` (`field_customer_coordinates_lat`),
KEY `field_customer_coordinates_lon` (`field_customer_coordinates_lon`),
KEY `field_customer_coordinates_top` (`field_customer_coordinates_top`),
KEY `field_customer_coordinates_bottom` (`field_customer_coordinates_bottom`),
KEY `field_customer_coordinates_left` (`field_customer_coordinates_left`),
KEY `field_customer_coordinates_right` (`field_customer_coordinates_right`),
KEY `field_customer_coordinates_geohash` (`field_customer_coordinates_geohash`),
KEY `field_customer_coordinates_centroid` (`field_customer_coordinates_lat`,`field_customer_coordinates_lon`),
KEY `field_customer_coordinates_bbox` (`field_customer_coordinates_top`,`field_customer_coordinates_bottom`,`field_customer_coordinates_left`,`field_customer_coordinates_right`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Data storage for field 26 (field_customer_coordinates)';

Can anybody tell me why its not working? Or, any other way to bulk populate 'Lat', 'Long' fields in 'Geofield' type?

Thanks,
Santanu Das