Monday, January 24, 2011

Quick Groovy Script! Google Geocoding!

Nice little script for parsing the Google Ceocoding Web Service. (Groovy 1.7.5)

Simple Script to parse the google geocode web service
def url = new URL(',+Mountain+View,+CA&sensor=true')
def geoCodeResult = new XmlParser().parseText(url.getText())
def lat =
def lng = geoCodeResult.result.geometry.location.lng.text()
println lat
println lng

Outputs :


  1. I used this geocoding in one of my personal projects

  2. Hey, thanks for this post! Just a question, does this pose any issues regarding the synchronous/asynchronous issue like javascript does?

  3. Hello, i am from USA, I want to share this great testimony about how Dr.Agbazara helped me bring back my ex lover, During my search for solution i came in contact with Dr.Agbazara details and through his help my lover came back to me within 48 hours. So with these i am so bold to advise anyone seeking for a way to get there lover back to contact Dr.Agbazara on WhatsApp: { +234 810 410 2662 } or via email at: { agbazara@gmail. com } I am so happy at least myself and my lover are back to each other again and going to spend the New Year celebration together Thank to Dr.Agbazara once again....