Python plugin example... Raster file info...

So there was a question on the mailing list about the existence of a plugin to capture information about the file path for a bunch of loaded rasters... similar to the info contained in a tileindex with GDAL but interactive from within QGIS.

Well, this motivated me to get my QGIS plugins organized. So, here are my SVN and TRAC links where I will be doing my plugin development work.

I went ahead and created a simple plugin to address the needs of the user who wanted to be able to get the raster file path info from loaded layers via a click on the screen. Since there is an issue with the Windows 0.9.1 plugin installer you will have to load this one manually until the 0.9.2 release is made. If you are running the 0.9.2 svn version of QGIS you should be able to just go to the plugin installer and select "Raster Info Plugin" since it has been uploaded to the plugin repository that QGIS knows about. If you have an older version of QGIS or cant get that to work you can just go ahead and unzip the plugin directly to your QGIS installation and it should show up in the plugin manager. On my win system that looked like this:

1) Download the plugin
2) Unzip it into the plugin dir of your QGIS install like:
C:\Program Files\Quantum GIS 0.9.1\python\plugins
to give you something like:
C:\Program Files\Quantum GIS 0.9.1\python\plugins\rasterinfo
3) Fire up QGIS and select the Raster Info Plugin from the plugin menu.
4) You will get an icon in the plugin menu bar that you can select

To use the tool, just load some rasters, select the Raster Info tool button and click on the canvas. You will get a popup with the names of all the rasters that intersect with their file paths. Simple.

Here is an example of what it looks like when using the plugin.

This is not meant to be a fancy plugin, but instead an example of how to take an easy problem and make a quick solution using the new python bindings in QGIS.

Looking forward to feedback and hope this helps some people out getting their python plugins going...

Aaron

For those of you who might

For those of
you who might be interested, the plugin is available via the plugin
installer if you add
http://www.geog.uvic.ca/spar/carson/cfarmerQgisRepo.xml

DVD Quality movie