Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Search plugin for QGIS 2.0 based on AstunTechnology's QGIS Gazetteer Search plugin
Fetching latest commit...
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
gazetteers Update
.gitignore Initial commit
httpd.conf Create httpd.conf


Search plugin for QGIS 2.0 based on @AstunTechnology's QGIS Gazetteer Search plugin by Nathan Woodrow (@NathanW2) and Matt Walker. Enhancements by Matt Travis, Kevin Williams and Simon Miles (and probably others).

This plugin requires QGIS 2.0+ and the QGIS Gazetteer Plugin installed. It will also need a webserver (Apache), a database (PostgeSQL/PostGIS), Python 2.7 and psycopg2, the python/postgresql connector. I have it installed and running on Windows 7 Professional.

  1. Download the zipped plugin from and unzip it into C:\Users\<UserName>\.qgis2\python\plugins\gazetteersearch on Windows 7. If using Windows XP install it into C:\Documents and Settings\<UserName>\.qgis2\python\plugins\gazetteersearch (make sure that the directory is called gazetteersearch and all the files are in this folder and not a subfolder).

  2. The plugin mentioned above has been updated to work with both 1.8 and 2.0.

  3. In the gazetteers subfolder, edit config.ini to include the gazetteers you want to search e.g:

    [LLPG] gazetteer:llpg

    [LSG] gazetteer:lsg

    The other gazetteers listed in the config.ini can be removed (Astun, Geonames, Yahoo) which I did as I couldn't get the proxy authentication to work through the firewall. Any gazetteers listed here will show up in the plugin in QGIS.

  4. Create a file called (i.e., the same name that you specified in the config.ini file) – see the attached version to duplicate and edit (the URL will need to be changed to point to your own web server).

  5. On the web server machine, install Python 2.7 ( and psycopg2 ( choosing the correct version to match your set up.

  6. You could use the latest Apache web server ( installed on your own PC in which case the URL will be http://localhost/cgi-bin/ otherwise if installed on another machine adjust the URL accordingly.

  7. Create a file in the cgi-bin folder of your web server. I have attached a script which you should be able to tweak to connect to your Postgres/PostGIS database. For each gazetteer listed in gazetteers/config.ini there will be a corresponding file in the gazetteers directory and another in the cgi-bin directory of your webserver.

  8. Check the httpd.conf and make sure the cgi-bin module is enabled, the path to apache2 is correct and permissions set to allow access. This may need to be tweaked to suit your environment.

This is the way that we have set up the plugin, with a web service generating search results in JSON format, which the plugin then reads. You might be able to avoid using the web service by doing the SQL query directly within the plugin code, but the web service is useful as it can be re-used by other applications.

Blog post with more information here:

Readme amended and updated from original supplied by @mtravis.

Something went wrong with that request. Please try again.