https://github.com/rahulsom/geocoder
Groovy lib for dealing with Geocoders
https://github.com/rahulsom/geocoder
geocoder geonames
Last synced: 7 months ago
JSON representation
Groovy lib for dealing with Geocoders
- Host: GitHub
- URL: https://github.com/rahulsom/geocoder
- Owner: rahulsom
- License: apache-2.0
- Created: 2014-05-25T16:41:56.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2024-09-24T04:00:04.000Z (about 1 year ago)
- Last Synced: 2024-10-08T08:46:48.188Z (12 months ago)
- Topics: geocoder, geonames
- Language: Groovy
- Size: 148 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Geocoder
====Geocoder Client that connects to several Geocoders. Written in groovy.
Usage
----To get it into your groovy script:
```groovy
@Grab('com.github.rahulsom:geocoder:1.0')
```To geocode something with google:
```groovy
def g = new GoogleCoder()
latlng = g.encode("1600 Amphitheatre Pkwy, Mountain View, CA 94043")
println "Center: $latlng"
```This prints
```
37.4219998,-122.0839596
```To reverse code a latlng, this time with Geonames:
```groovy
def latlng2 = new LatLng(lat: 37.4219998,lng: -122.0839596)
def address = new GeonamesCoder('demo').decode(latlng2) //?.normalize()
println address
```This prints
```
com.github.rahulsom.geocoder.domain.Address(1646, Charleston Rd, Mountain View, CA, US, 94043)
```You need to sign up for an account with Geonames to make this work.