UPDATE April 11, 2013: Updated the directions because the “Add delimited text layer” function moved from the Plugins to Layer menu. 

UPDATE March 24, 2011: I updated the directions to use GPS Visualizer instead of BatchGeocode.com because BG stopped giving geographic coordinates in its output.

Get directions on geocoding a single address in QGIS with a plugin.

QGIS is an open-source Geographic Information Systems (GIS) application that has been gaining ground since 2004. It runs on all operating systems (it began as a Linux project) and you can download it for free.

I use it often because ESRI doesn’t make the popular ArcGIS software for Mac. That’s unfortunate, but like I said here, software, technology and mapping issues can be easily overcome – we can use QGIS to create maps. QGIS, though, is missing one major feature for basic map building: geocoding.

Here’s a step-by-step tutorial on how to bring in multiple street addresses and their XY coordinates into your QGIS map en masse:

To get “batch geocoding” in QGIS:

  1. Go to Plugins>Manage Plugins
  2. Check the checkbox next to “Add Delimited Text Layer
  3. Click Okay to add the plugin to your QGIS
Now you’re ready to do your batch geocoding which you’ll import into QGIS.
  1. In a spreadsheet, create the following columns in a header row (at a minimum): address, city, state. Other fields you can use: description, name, url, zip, image url
  2. Input your data into the appropriate columns
  3. Save the Excel document as a Tab Delimited Text file.
  4. Open the newly created Tab Delimited Text file in a text-only editor (like Notepad for Windows, TextEdit for Mac, or vi for Linux). Select all the text (including the headers) and copy to clipboard
  5. Go to GPS Visualizer’s multiple address geocoder.
  6. In the first text field, paste your text (ideally, you should only process 150 rows at a time)
  7. Set your options: Select whether your text is tabbed data with a header row, or just one address per line (no header). Then choose your geocoder, either Yahoo! or Google. Select the delimiter.
  8. Click Start Geocoding.
  9. Copy your now geocoded data back into your text-only editor and save.*
Now you’re ready to import this geocoded data into QGIS.
  1. In your QGIS document, select Layer>Add delimited text layer.
  2. In the dialog box, click Browse and find your newly created file.
  3. Create a layer name – the default is ugly, but you can change it later.
  4. Since your text file is tab-delimited, make “t” your delimiter for this import
  5. Click the Parse button to validate your input (Parse will also attempt to find your columns that hold the latitude and longitude)
  6. Ensure the X and Y fields have selected the appropriate columns in your text.
  7. Press OK!
Now you’ll see in your layer list the new layer with the data you batch geocoded. If you want to change the style, right click the layer and click Properties.

Leave a comment if this tutorial worked for you.

*If the text file isn’t saved correctly and the delimiter characters aren’t inserted into the file’s source code properly, QGIS won’t import the text properly – it won’t display on your map. On the Mac, an application called XTabulator can help you correct the text file. The QGIS plugin “Delimited text” prefers tabbed files with records separated by CR+LF (File>Document Settings). You can also use the plain text editor  to sort out the issue.

Alternative: Use GeoCommons to geocode your data and output the results to you as a CSV, KML, or shapefile.