Skip to content

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

Notifications You must be signed in to change notification settings

HandsOnDataViz/google-sheets-geocoder

 
 

Repository files navigation

Google Sheets Geocoder

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

UPDATE

To geocode multiple addresses inside your spreadsheet, we now recommend that beginniners install a free Google Sheets Add-on called Geocoding by SmartMonkey, instead of the Google Apps Geocoder script below.

See geocoding instructions in Hands-On Data Visualization chapter 2: https://handsondataviz.org/geocode.html

Geocoding by SmartMonkey screenshot

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

About

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

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published

Languages

  • JavaScript 100.0%