1

There's a plugin called "create mask" for qGIS and trying out some simple scripting from the Python console.

I would like to call it after I select the vector features I want, then do more related tasks afterwards. So, how does one run "create mask" from the console?

n1kn0k
  • 499
  • 7
  • 19

1 Answers1

1

I have no solution for doing this in python (you can easily call plugins with Sextante support, but i don't know how to call qgis plugins in general), but i highly advise you to take a look at the Sextante toolbox and its modeler. The SAGA extension for Sextante has a similar Mask creation function (Create Grid Mask). Using the Sextante modeler you can build processing chains without any script use.

Curlew
  • 8,152
  • 5
  • 36
  • 72
  • @ Thanks for suggesting this. I'm trying it out but couldn't find this "create grid mask" from the SAGA extension of Sextante. Am I supposed to install anything else? – n1kn0k Mar 07 '13 at 22:59
  • If you installed Sextante and SAGA and have correctly linked the SAGA-Install dir in the Sextante options, then the function should appear as "Grid Masking". Is this what you want? I am not so sure anymore and the word mask has been used in many different contexts. – Curlew Mar 07 '13 at 23:02
  • I can see that now "Grid Masking" but I'm encountering problems with SAGA and Ubuntu 12.04. An error pops out: "It seems that SAGA is not correctly installed in your system. Please install it before running SAGA algorithms." When I ran saga_cmd, I found: error: Library does not contain executable modules [librecreations_games.so] – n1kn0k Mar 08 '13 at 11:56
  • did you compile it yourself or use a pre-compiled binary? On linux Sextante should be able to automatically determine your saga install folder, therefore there is a problem with your saga install. Download the latest src and compile it / install systemwide http://sourceforge.net/projects/saga-gis/files/SAGA%20-%202.0/ – Curlew Mar 08 '13 at 12:09
  • i used a package i found from the ubuntu Precise repos, version 2.07b – n1kn0k Mar 08 '13 at 12:54
  • After adding a more current repo: ppa:johanvdw/saga-gis. It now works. The tool though is for raster layers. I forgot to mention I'm working on vector shapefiles. – n1kn0k Mar 09 '13 at 05:12
  • mhh, i don't really get what you want to achieve with this 'mask' as i know the word only in context with raster files. Maybe you can explain a bit more by editing your question. – Curlew Mar 09 '13 at 09:57
  • The "mask" is a styling effect using transparency over neighboring features (say 10%) to highlight the POI feature – n1kn0k Mar 10 '13 at 12:29
  • Then all you need to know can be found in already existing answers here (http://gis.stackexchange.com/questions/7073/qgis-how-to-create-an-area-of-interest-polygon-mask?rq=1). – Curlew Mar 10 '13 at 12:33