Coder Social home page Coder Social logo

qgis-gazetteer-search's Introduction

qgis-gazetteer-search

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 https://github.com/AstunTechnology/QGIS-Gazetteer-Plugin 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.

  1. Create a file called llpg.py (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).

  2. On the web server machine, install Python 2.7 (http://www.python.org/download/releases/2.7.5/) and psycopg2 ( http://www.stickpeople.com/projects/python/win-psycopg/) choosing the correct version to match your set up.

  3. You could use the latest Apache web server (http://www.apachehaus.com/cgi-bin/download.plx) installed on your own PC in which case the URL will be http://localhost/cgi-bin/llpg_pg.py otherwise if installed on another machine adjust the URL accordingly.

  4. Create a file in the cgi-bin folder of your web server. I have attached a script llpg_pg.py 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.

  5. 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: http://ukqgis.wordpress.com/2013/11/01/how-the-west-was-won-or-qgis-rocks/

Readme amended and updated from original supplied by @mtravis.

qgis-gazetteer-search's People

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

zawszaws

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.