Skip to content

Uses the Google Geocoding API to find the lat/long values of each location listed in an input CSV file

Notifications You must be signed in to change notification settings

HenryW95/GeocodeTowns

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Geocode Towns

'GeocodeTowns.py' uses the Google Geocoding API to find the latitude and longitude of each location listed in an input CSV file. The data is then output in a CSV file in the 'GeocodeTowns/Output' directory. The output file can be easily used in ArcMap or another GIS as 'XY' data.

Inputs

-The 'InputTownList' should be the file path of your input CSV file. Your CSV file’s first column should be a list of towns and the second column should be the towns' corresponding state, state abbreviation, or country.

-The 'APIKey' input should be your Google API key. This key can be obtained for free from Google but there is a limit of 2,500 requests per 24 hour period (1 request = 1 location from your input CSV file). Instructions on how to obtain a key from google can be found at the following url: https://developers.google.com/maps/documentation/geocoding/?hl=en_US#api_key

Example Usage

from GeocodeTowns import geocodeTowns
InputTownList = "SampleInputList.csv"
APIKey = "YOUR_API_KEY"
geocodeTowns(InputTownList, APIKey)

Sample input CSV file:

input

Sample output CSV file:

output

About

Uses the Google Geocoding API to find the lat/long values of each location listed in an input CSV file

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages