Created
December 12, 2012 04:01
-
-
Save sunny0425/4264769 to your computer and use it in GitHub Desktop.
use geocoder(gem) to find postal code from a city
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Geocoder.coordinates("Shanghai, China") | |
=> [31.230393, 121.473704] | |
results = Geocoder.search('31.230393, 121.473704') | |
r = results.first | |
r.postal_code |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
奇怪的,居然弄成了匿名gist, 貌似正在改版,原地址(木有样式):https://gist.github.com/4264746