How can I get lat/lon from an address? I have these modules

addressfield
geofield
geocoder


Is there any function to which I can pass an address like Stree, zipcode city, Country and it returns a lat/lon from that address?

I have searched in the code of geofield and geocoder but unable to find any helper function.
Using google geocoding with geocoder module, you may use another geocoding provider, i think this requires a google map token now given google's new rules :

// @return Geometry Returns a geoPHP geometry object. Generally a Point.
$point = geocoder('google', $address);
$lat = $point-&gt;coords[1];
$lon = $point-&gt;coords[0];


I did this long time ago, please check.