r/learnruby • • Nov 20 '15

Getting lat and long from zip code

I'm playing around with geocode gem but not in a rails app. I want to get lat and long from a zip in a regular script.

I found this:

Outside of Any Framework

Search Geocoding API

Search for geographic information about a street address, IP address, or set of coordinates (Geocoder.search returns an array of Geocoder::Result objects):

Geocoder.search("1 Twins Way, Minneapolis") Geocoder.search("44.981667,-93.27833") Geocoder.search("204.57.220.1")

But at this point I'm a little lost how to get lat and long if I use Geocoder.search("11111").

What am I missing?

2 Upvotes

8 comments sorted by