/**
Simple Script to parse the google geocode web service
http://code.google.com/apis/maps/documentation/geocoding/
*/
def url = new URL('http://maps.googleapis.com/maps/api/geocode/xml?address=1600+Amphitheatre+Parkway,+Mountain+View,+CA&sensor=true')
def geoCodeResult = new XmlParser().parseText(url.getText())
def lat = geoCodeResult.result.geometry.location.lat.text()
def lng = geoCodeResult.result.geometry.location.lng.text()
println lat
println lng
Outputs :
37.4216227
-122.0840263