I am curious if there are any tools for QGIS to facilitate geocoding tabular data using a local linear features layer (ie, a street map with street name and address ranges - similar to geocoding in ArcGIS). I am aware of Alessandro Pasotti's GeoCoding plugin, but it queries Google Maps/OpenStreetMap rather than interpolating along line segments of a user-provided layer.

One reason I am interested in this approach is that for some projects it is desirable to have geocoded points placed exactly on features from other project-specific layers, such as the street maps provided by local services or municipalities, which may not necessarily match the positions returned by web services.

Any ideas - or any input in case I have a go at writing a solution from scratch?

3 Answers 3


I haven't tried it but you could give "Geocode from Street Layer" in MMQGIS a try

The street address geocoding tool requires a layer with street centerline features and attributes indicating the range of addresses associated with each feature. For each feature there is a from x/y and to x/y (in map coordinates), a range of addresses on the left side, and a range of addresses on the right side.

enter image description here

  • Thanks! I had not found MMQGIS (it did not come up in a search for "geocode"/"geocoding" in the Fetch Python Plugins window.) The "Geocode from Street Layer" tool looks like it will fit the bill.
    – anoved
    Commented Apr 5, 2012 at 20:46
  • Hmm. I've successfully installed MMQGIS - the plugins appear in a "mmqgis" submenu under Plugins - but nothing appears when I select "Geocode from Street Layer" (or any other MMQGIS plugin). I'm using QGIS 1.7.4 on Mac OS X 10.7.3. I've restarted QGIS; same situation. Any tips for getting these plugins to activate? (Apologies if I've missed some obvious step.)
    – anoved
    Commented Apr 5, 2012 at 20:50
  • Thanks to @dakcarto for suggesting a fix to activate the MMQGIS plugins properly. "Geocode from Street Layer" is a good starting point. (My ideal geocoding plugin would be able to determine the street segment endpoints from the actual feature geometry - this plugin looks for the endpoint coordinates to be provided in the attribute table.)
    – anoved
    Commented Apr 5, 2012 at 22:33

@anoved I'm using QGIS 1.7.4 on Mac OS X 10.7.3 as well. Inspection of the downloaded mmqgis plugin shows that it registers its PyQt menu actions' signals as per Qt 3.x instead of Qt 4.x. I did the following to get mmqgis forms to open (didn't test beyond that).

EDIT: The following find/replace fix has been a applied by the mmqgis plugin author (version 2012.04.06).

Quit QGIS.

Open ~/.qgis/python/plugins/mmqgis/mmqgis_menu.py in a text editor and find/replace the following...

find: SIGNAL("activated()")
replace with: SIGNAL("triggered()")

Then, restart QGIS and the forms should show up.

When trying to install, if you get the following error:

The plugin is broken. Python said:
'module' object has no attribute 'classFactory'

It may be because you have the new SEXTANTE plugin already installed, and its included mmqgis module is causing a namespace conflict.

  • I had same problem. My workaround is: 1. installed pyqt-tools and pyqt4-dev-tools. (<--- i think this is the root cause of error. those files are required.) 2. installed mmqgis from fetch plugin. 3. restart qgis 4. goto fetch plugin, and install geocode 2.3. It will install successfully with no error.
    – user7143
    Commented Apr 25, 2012 at 15:53

I perform manual linear referencing (geocoding) on a daily basis.

The area I do this for is large. Because of this, a consultant was hired to study the region and develop a grid some time ago that we could use to assign a min and max to the endpoints of roads; also incorporating orientation of the civic address on the road (north/south vs east/west side)

You will need a policy or some guidelines to go by.

For example, when it comes to road orientation, we first look at the roads orientation: is it travelling north/south or east/west?

Then we look at the side of the road that the new address is: on the west/east side or north/south side.

From those two, we can decide whether or not the new number is going to be even or odd!

The guiding chart we use:
West/North side of road = EVEN
East/South side of road = ODD

Now you need to have someway of giving the min and max... Like I said, for our case, we have a grid to use and depending on where the road intersects the grid, that is the assigned min and max.

We also assign the new number based on where the driveway intersects the nearest public road.

There are two methods that I mostly use. One involves using existing house numbers as a reference to get the new number and the other involves using the 'reference grid'.

  • Method 1) Using existing house numbers:

In the following image
- houses 1465 and 1592 are the closest (being on either side of the new house), so I start with those where:
h1 = 1465, h2 = 1592 and...
d1 = "distance from h1 to new house", d2 = "distance from h2 to new house"...
which would look like:
( ((h2-h1)/(d2 + d1)) * d1 ) + h1 -> ( ((1592-1465)/(510m+156m)) * 156 ) + 1465
= ( (127/666) * 156 ) + 1465
= 1494.8 (+/-1 to round and make even or odd...)
= 1494!

Note, that above, when I measure along the road, I am measuring where those houses driveways meet the road, NOT the distance between the physical location of the house!

  • Method 2) Using the 'reference grid':

First measure the total length of one reference grid to the other.

In the image, we need to measure from West 1600 to West 1400 (r1) (off the map) which gives us a total of 2800m (d2) .

This is HUGE! Usually I deal with a smaller distance of around 500-1000m.

Also get the difference between the two grid lines you measured, so 1600-1400 = 200 (d1) !

Finally, measure from the grid line with the lowest number (West 1400) to the point where the new buildings driveway meets the road: 2400m (d3) .

Your formula will look like: ( (d1/d2)*d3 ) + r1 -> ( (200/2800)*2400 ) + 1400
= 1571.4 (+/- for rounding to make odd/even)
= 1570!

Reference Image: linear referencing example

Why do I get different results?
Because the existing numbers were most likely issued 'before my time' and had to be issued when little to no data was available. Eg, parcel lines could of been missing, road centrelines have changes, reference grid wasn't available.

So most of the time I end up issuing new numbers based off of existing numbers instead of the reference grid because a) the new number fits better and b) the reference grid is fairly new so it wasn't always used. Not sure what was used before it was created either!

CONCLUSION: So I guess in the end, you could use method 1 and determine what the min and max would be for a road segment then place points along the road at equal intervals of 1-10 m then interpolate what those points 'would be'. Then, when you get a new number to geocode, you can look at what point it lies nearest to (where the driveway meets the road) and determine the number from that.

Also be aware that in our case, because we have a manual method based off a custom grid, Google cannot be used reliably for geocoding results unless we were to share this information with them directly.

EDIT: I really like the look of the tool from MMQGIS suggested by @underark That will definitely make things easier.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.