Geocoding Addresses with 2.8 QGis

Geocoding addresses allows you to transform addresses into a layer of points, from a text info into a spatial info. This is, mainly, used in geomarketing and transport, but due to the development of web applications it proves very useful in almost all areas of GIS.

The problem with geocoding is not technical but related to the evolution of techniques and available resources. If you search on Google « géocodage adresses France » you will get some very detailed tutorials, but often out of date. Here is such a tutorial to the taste of the month of May 2015 that we will update (promised!) when he becomes obsolete.

It is possible to geocode addresses from QGis for free. There are 2 plugins that makes this possible:
-The Geocode plugin displays a window where you can retrieve an address and that generates the corresponding geographical point. It uses either Google or Nominatim (OpenStreetMap’s)
-the MMQGIS plugin that accepts an input table as a text file and generates a layer of points. This plugin uses Google and Openstreetmaps, or a specific layer of the road network.

Neither plugin requires a Google API key, just the installation of the plugin.

The first plugin is very simple: install, launch, retrieve an address and see the resulting point, here we will discuss how to treat an address table.

Plugin installation

Click Extension -> Install / Manage Extensions

 

Select   mmqgis   then   Install the extension.

Then, you will have a new MMQGIS menu:

The data to geocode

The format used to enter the data to geocode is the text format csv (comma separator). As we will use a web service (either google or OpenStreetMap) it is advisable to minimally configurate your addresses.
Even if it is not essential, will avoid geocoding errors by creating   three fields:   street   ( or address ),   city   and   country

 

 

You enter the field names on the first line of the file, separated by commas, then the different addresses to geocode, one per line of the file .

Using the MMQGIS plugin

We will use the Geocode option which offers two options:

-Geocode csv with Google / OpenstreetMap

-geocode with Street layer

Here we will use the first option. In order to use the second one you must own a road network layer with four fields for each section , four fields containing the mini-max numbering for each side of the street.

By clicking on the menu   MMQGIS -> Geocode -> Geocode csv with Google / OpenstreetMap   you open the plugin configuration window:

 

In   Input csv file, click on your file text

Open the following windows: Address field,   City field   and   Country field   to assign them the names of your  text file ( here   street ,   city   and   country ).

Choose the adequate web service to use (Google or OpenStreetMap). Google established some limitations as to the quantity of addresses geocoded per day (currently 2500). It is not likely to reach this amount, but if you happen to, see the page https://developers.google.com/maps/documentation/geocoding/, then try OpenStreetMap.

In   Output shapefile   give the name to the file result

In   Not found output list   give a name to the file text where the addresses that have not been be geocoded will be stored. You can edit this file to correct the addresses and use it as file for the plugin.

The resulting shape file contains two additional fields:

addrtype  : corresponding to the  Google element   type   or to the   OpenStreetMap class attribute . This field indicates the type of address that has been used by the web service (locality, road, place, park, highway, …)

addrlocat  : corresponds to the Google  location_type    or   OpenStreetMap attribute type . This field indicates the accuracy of the location (geometric centre, interpolation, approximation, …)

Once launched, the command displays the result in the cartographic window:

 

One thought on “Geocoding Addresses with 2.8 QGis”

Leave a Reply

Your email address will not be published. Required fields are marked *