Last active
October 21, 2015 22:19
-
-
Save glw/28f4cce2a2a295376e96 to your computer and use it in GitHub Desktop.
python geocoder example
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
sudo pip install geocode | |
sudo apt-get install jq | |
sudo apt-get update | |
#from command line | |
#geocoder does not have to be google | |
#to save as json | |
geocode -p "google" addresses.txt | jq -r -c '@json' >> results3.json | |
#to save as csv | |
echo 'lat,lng,address,city,state' > results4.csv #use if you need to add column headers to csv | |
geocode -p "google" addresses.txt | jq [.lat,.lng,.address,.city,.state] -c | jq -r '@csv' >> results4.csv | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment