Skip to content

Instantly share code, notes, and snippets.

@jmalonzo
Created January 15, 2017 05:50
Show Gist options
  • Save jmalonzo/a6c5f0cf84c9326d8797c119297b9d64 to your computer and use it in GitHub Desktop.
Save jmalonzo/a6c5f0cf84c9326d8797c119297b9d64 to your computer and use it in GitHub Desktop.
Geocode custom function for Google Sheets
/**
* Geocode address using Google Maps
*
* @param address the address to geocode
* @return the geocoded address (possibly approximate)
*/
function geocode(address) {
var response = Maps.newGeocoder().geocode(address);
var geom = response.results[0].geometry;
return geom.location.lat + ", " + geom.location.lng;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment