How to geocode in open-source QGIS

Quantum GIS (commonly known as QGIS) is an open-source Geographic Information Systems 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 used it a couple times 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 addresses onto your QGIS map:

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 www.batchgeocode.com
  6. In the first text field, paste your text
  7. Click the Validate Source button
  8. In Step 4 on the website, map the columns from your text to their appropriate fields in all the drop down boxes
  9. When you’re done selecting the options, click Run Geocoder.
  10. Copy your now geocoded data back into your text-only editor and save.* The website may have changed and you may have to click on “show results” before you can copy the geocoded data.
Now you’re ready to import this geocoded data into QGIS.
  1. In your QGIS document, select Plugins>Delimited text>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 howto 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.

Tags: , , , , , , , , , ,

-Steven Vance

Do more with this post

Related Posts
  1. The importance of sharing data in KML format
  2. Google Maps and Earth is the poor man’s GIS

  • This is a nice post. I'm suprised nobody else has remarked on it. Good work.
  • Thank you.
    No one else commented on it because few people visit my blog.
blog comments powered by Disqus