Skip to content

ilyankou/geocoder-for-google-sheets

Repository files navigation

Google Sheets Geocoder

Geocode addresses into latitude/longitude coordinates inside Google Sheets, with US Census or Google Apps service

Demo Geocoder US Census or Google

Screencast

Demo Geocoder US Census Geographies

Screencast

About 15-character GeoID

  • Make sure that column G is formatted as text (to preserve leading zeros), not number
  • Break down a sample GeoID: 090035245022001
    • state = 09
    • county = 003
    • tract = 524502 = 5245.02
    • block group = 2
    • block = 001

How to insert script into any Google Sheet

  • Download or fork the Google Sheets scripts (.gs) from this GitHub repo
  • Go to your Google Sheets > Tools > Script Editor
  • File > Create New Script File
  • Copy and paste contents of your preferred script (such as geocoder-census-google.gs)
  • Save as Code.gs (or save, then rename to geocoder-census-google.gs)
  • Refresh your Google Sheet and look for new Geocoder menu

See also: Batch upload to US Census

  • Available at US Census Geocoder https://geocoding.geo.census.gov/geocoder/
  • Upload up to 1000 rows
    • Find Locations using > Address Batch (returns latitude, longitude coordinates)
    • Find Geographies using > Address Batch (returns lat, lng, census geographies)
  • Upload CSV table with up to 1000 rows for faster processing, in this format:

| AnyID | Street | City | State | Zip | | :----- | :----- | :--- | :---- | : --- | | 1 | 300 Summit St | Hartford | CT | 06106 |

Learn more

Credits

Testing