How do I programmatically populate longitude and latitude fields when Geolocation used in content type I am using the Geolocation module and I have created a custom content type (we'll call it Bookshop), which contains a field called location and is of type Geolocation.

I can already programmatically create the custom content type instance and programmatically populate the title field.

    $node=Node::create(
      'title'=&gt;'Shop 1'
    );

    $node-&gt;save();


How would I go about populating the the Geolocation field content (e.g. the longitude and latitude fields in the Geolocation field)?  e.g.

    $node=Node::create(
      'title'=&gt;'Shop 1'
      'Geolocation field'=&gt;array ('latitude'=&gt;'1', 'longitude'=&gt;'2.33'),
    );


An approach such as the one above does not appear to work?
Pretty straight forward just had to change the field names to correspond with the field names used by Geolocation:

$node=Node::create(
  'type' =&gt; 'content type - machine name',
  'title' =&gt; 'Shop 1',
  'geolocation_field' =&gt; ['lat'=&gt; 1, 'lng' =&gt; 2.33]
);
$node-&gt;save();