Introducing the Landscape modifier to LecoS
i just pushed a new update to my QGis-plugin LecoS called the “Landscape Modifier“. At first it sounds strange by name, but i believe that it can be really useful even in cases that don’t involve any ecological expertise. In fact the desire to add these functions has been one of many reasons i even started coding this plugin. I am fascinated by the possibilities the scientific python library Scipy and also scikits offers in matters of image analysis. With just a few lines of code one could easily filter, denoise and improve images as demonstrated on this very good tutorial site. This can be useful in GIS-applications as well as raster layers are in fact very similar to image files. In essence both consist of multiple rows and columns containing data values. So moving from images to raster layers in GIS-systems isn’t so hard at all. But now about the plugin update.
I added the following functions:
- Extract Landscape patch edges (Returns a raster with only the outer borders of raster patches)
- Isolate greatest/smallest patch (Returns only the smallest or biggest patches of landscape class)
- Increase or decrease landscape patches (Returns a raster with landscape patches inc./dec. x times)
- Fill Holes inside landscape patches (Closes inner holes of landscape patches)
- Cleans landscape of small border pixels (Removes all pixels smaller than x times a taxicab structure)
Here is a practical use-case. I performed a supervised landscape classification using training polygons to extract tree cover from a study location in western Africa. There are a lot of errors, small pixels and holes in the woodland and i will try to improve that a little. My previous landscape classification looks like this:
After executing “Fill holes“, a “small pixel cleanup” and an “increase” of all woodland pictures the result looks like the picture below. Of course the question if one should perform those operations should always be cleared first. Think about your classification critically and if it can be improved. In my case i only wanted the major trees and i am not interested in any artifacts or smaller shrubs.
Download the new update via the QGis plugin downloader or here. Please contact me only in case you found a bug and not about operating system specific questions (like how do i install scipy). I probably won’t answer to those question anymore!
The next mayor milestone for LecoS will probably be SEXTANTE toolbox support ! Furthermore i would really want to see a plugin using all the various available scipy.ndimage functions. I believe that it is just a matter of time before such a plugin shows up. Many of the various methods could really be useful in QGis, for example for DEM smoothing as demonstrated in this or this gis.stackexchange answers.