[GRASS-SVN] r51439 - grass-addons/grass6/raster/mcda/r.mcda.roughset

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Apr 14 04:56:35 EDT 2012


Author: gianluca
Date: 2012-04-14 01:56:35 -0700 (Sat, 14 Apr 2012)
New Revision: 51439

Modified:
   grass-addons/grass6/raster/mcda/r.mcda.roughset/r.mcda.roughset.py
Log:


Modified: grass-addons/grass6/raster/mcda/r.mcda.roughset/r.mcda.roughset.py
===================================================================
--- grass-addons/grass6/raster/mcda/r.mcda.roughset/r.mcda.roughset.py	2012-04-14 07:55:36 UTC (rev 51438)
+++ grass-addons/grass6/raster/mcda/r.mcda.roughset/r.mcda.roughset.py	2012-04-14 08:56:35 UTC (rev 51439)
@@ -57,6 +57,10 @@
 #% answer:infosys
 #% required: yes
 #%end
+#%flag
+#% key: l
+#% description: do not remove single rules in vector format
+#%end
 
 import sys
 import copy
@@ -528,10 +532,12 @@
         grass.run_command("r.to.vect", overwrite='True', flags='s', input=m, output=m, feature='area')
         grass.run_command("v.db.addcol", map=m, columns='rule varchar(25)')
         grass.run_command("v.db.update", map=m, column='rule', value=m)
+	grass.run_command("v.db.update", map=m, column='label', value=" ".join(m.split('_')[1:]))
     grass.run_command("v.patch", overwrite='True', flags='e', input=mapstring, output=outputMap)
     
     grass.run_command("g.remove",  rast=mapstring)
-    #grass.run_command("g.remove",  vect=mapstring)
+    if not flags['l']:
+    	grass.run_command("g.remove",  vect=mapstring)
 
 
     return 0
@@ -548,7 +554,6 @@
         outputMap= options['outputMap']
         outputTxt= options['outputTxt']
         out=BuildFileISF(attributes, preferences, decision, outputMap, outputTxt)
-        
         infosystem=FileToInfoSystem(out)
         
         UnionOfClasses(infosystem)



More information about the grass-commit mailing list