- Release plans recap for the road to QGIS 1.0
- New version of eVis
- Contour Lines in Qgis
- QGIS and Google Summer of Code
- Quantum GIS Graduates OSGeo Incubation
- Paolo Cavallini Named to QGIS Project Steering Committee
- Nominations for QGIS PSC Open
- Capturing map coordinates in a stand alone app...
- Tutorial 7 - Creating spatial datasets with the QGIS API
- Html Image Plugin 0.2
Python plugin example... Raster file info...
Submitted by aaronr on Mon, 2008-01-14 19:14.
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
- aaronr's blog
- Add new comment
- 4127 reads

Recent comments
1 day 11 hours ago
1 day 13 hours ago
1 day 16 hours ago
1 day 17 hours ago
3 days 9 hours ago
2 weeks 1 day ago
3 weeks 1 day ago
3 weeks 1 day ago
4 weeks 5 days ago
4 weeks 6 days ago