Skip to main content

QGIS Introduction: Geocoding

Formatting the CSV file

Tips for cleaning spreadsheet data in preparation for plotting addresses or x, y data:

  • Split the address information into multiple columns for (1) street address, (2) city, (3) state, and (4) 5-digit ZIP code. For instance, the address 411 Chapel Drive, Durham, NC 27708 should be split into 4 columns in a csv file.  When you plot these addresses in QGIS, the program will ask for the address, city, state, and zip in separate columns.
  • For latitude and longitude data, make sure there are 2 columns and any extraneous characters are deleted (i.e. commas, parenthesis).  Longitude is the X value and latitude is the Y value. Also, make sure you do not delete any minus (-) symbols as this will define the spatial location (negative longitudes are west of Greenwich, and negative latitudes are south of the equator).
  • When adding x, y data or data with address information, the saved document must be a csv file.

Geocoding

  1. Click on the Plugins menu at the top of QGIS and select "Manage and Install Plugins..."
  2. Type "MMQGIS" in the search box and click install in the lower-right corner of the Plugins GUI.  Close out of the Plugins GUI.
  3. MMQGIS menu is added to the menu bar at the top of QGIS.  Click on the MMQGIS menu, mouseover Geocode, and select "Geocode CSV with Google/Open Street Map."  (The Google Maps Geocoding API that this calls up has a usage limit of 2500 geocodes per day.)
  4. You will need to do 4 things in the Geocode GUI:
    1. Click Browse and go to the folder where your .csv file is located and click on the .csv.
    2. Populate the fields in the Geocoding GUI with the fields from the .csv.
    3. Browse to a folder where you want the resulting shapefile to be.
    4. A .csv file will be created with the addresses the software could not find.  Browse to a folder where you want the .csv to be created.
    5. Click OK.                                                     
  5. The map canvas will show the results: