Cannot use object of type stdClass as array error in node save
Assuming this is Drupal 7 field_locationmap is an array so your assignment should look something like this:

$location-&gt;field_locationmap['und'][0]['geom']['lat']


Also make sure that['geom']['lat'] is the correct structure for that value (i.e it is an array with two keys)
P.S. Consider using $location->language instead of 'und' in case you support multiple languages.