May 28 2007
QGIS Geocoding plugin
A few weeks back, I decided to take the plunge and learn the python bindings for QGIS 0.9. My first experiment was to implement a geocoder plugin. What started mostly as a learning experiment turned into something that might actually be useful!
The idea was to use web services to do all the actual geocoding work (the hard part!) and the delimited text provider to load the results into qgis. Right now it’s built on top of the Yahoo geocoder which is, IMO, the best out there.. very flexible about the input format. The geopy module is used to interact with the geocoding services so it could potentially support other engines such as geocoder.us, virtual earth, google, etc.
The user interface is very straightforward; enter list of addresses/placenames seperated by a line break, pick an output file and go. To be legitimate, you should also sign up for a yahoo api key, though the ‘YahooDemo’ key will work ok for testing purposes.
Here’s the install process (assuming you already have python, pyqt4, qgis 0.9, qgis bindings, etc. set up):
svn checkout http://perrygeo.googlecode.com/svn/trunk/qgis/geocode cd geocode emacs Makefile # change install directory if needed sudo make install
This is just a rough cut and it’s my first attempt at using the qgis and qt apis so there are probably many things that could be improved upon. Ideally this plugin could:
- Parse text files as input
- Allow for a choice of geocoding engine
- ???
Feedback (and patches) welcome ![]()
Hi Matt,
Looks like a great plugin but am not able to get it to work under QGIS 0.8 ‘Titan’ running on Debian Feisty. No matter where I install it the plugin doesn’t appear in the manager. I am a newbie when it comes to QGIS so might be missing the obvious. As most QGIS forums seems to be down I was hoping you could point me in the right direction.
cheers,
Mark
Mark,
This plugin requires QGIS 0.9 with python bindings enabled.
Ok, am now trying to install 0.9 according to the install process you describe. Got stuck at the QGIS part however, as the syntax you include ‘cmake’ expects a parameter location so basically nothing happens. Any advice?
Matt,
Managed to install QGIS unstable now using instructions on: http://spatialgalaxy.net/2007/04/27/building-qgis-on-feisty-fawn/. Was probably missing some packages somewhere…
Still can’t figure out how to enable the plugin however, it doesn’t show up in the plugin list. Am I missing the obvious?!
cheers,
Mark
Hi,
I was looking at the python code of your app, because i’m looking for a method to parse the result of the (google geocoder) geocoded adress, would like to retrieve all the accuracy, and the detailed informations about the adress, just like when using the Js api.
I do something like that :
location, (latitude, longitude) = g.geocode(adresse,
exactly_one=True)
print location
would something like that work ? :
location, (latitude, longitude),altitude = g.geocode(adresse,
exactly_one=True)
print altitude
In fact it does not work, is it possible to retrieve all these informations
from the geopy google geocoder response and how to ?
Thks a lot
Julien
Perry, the geocoder used to play an interesting role in QGis, as a bridge from desktop to web services. Now it’s not even anymore compatible with later versions. What about revamping it?
I’d love to update it but have no time or interest in doing so. I wrote it as a test plugin for 0.9 so someone is welcome to port it over to the stable API if they wish .. the beauty of open source!