[GRASS-SVN] r46407 - grass/branches/releasebranch_6_4/gui/wxpython/gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Tue May 24 10:49:17 EDT 2011


Author: neteler
Date: 2011-05-24 07:49:16 -0700 (Tue, 24 May 2011)
New Revision: 46407

Modified:
   grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/layertree.py
Log:
offer univar stats in map menu

Modified: grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/layertree.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/layertree.py	2011-05-24 14:06:42 UTC (rev 46406)
+++ grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/layertree.py	2011-05-24 14:49:16 UTC (rev 46407)
@@ -262,7 +262,7 @@
             for key in ('remove', 'rename', 'opacity', 'nviz', 'zoom',
                         'region', 'export', 'attr', 'edit0', 'edit1',
                         'bgmap', 'topo', 'meta', 'null', 'zoom1', 'region1',
-                        'color', 'hist', 'prof', 'properties'):
+                        'color', 'hist', 'univar', 'prof', 'properties'):
                 self.popupID[key] = wx.NewId()
         
         self.popupMenu = wx.Menu()
@@ -388,6 +388,8 @@
             self.Bind (wx.EVT_MENU, self.OnColorTable, id = self.popupID['color'])
             self.popupMenu.Append(self.popupID['hist'], _("Histogram"))
             self.Bind (wx.EVT_MENU, self.OnHistogram, id = self.popupID['hist'])
+            self.popupMenu.Append(self.popupID['univar'], _("Univariate raster statistics"))
+            self.Bind (wx.EVT_MENU, self.OnUnivariateStats, id = self.popupID['univar'])
             self.popupMenu.Append(self.popupID['prof'], _("Profile"))
             self.Bind (wx.EVT_MENU, self.OnProfile, id = self.popupID['prof'])
             self.popupMenu.Append(self.popupID['meta'], _("Metadata"))
@@ -398,6 +400,7 @@
                 self.popupMenu.Enable(self.popupID['region1'], False)
                 self.popupMenu.Enable(self.popupID['color'],   False)
                 self.popupMenu.Enable(self.popupID['hist'],    False)
+                self.popupMenu.Enable(self.popupID['univar'],  False)
                 self.popupMenu.Enable(self.popupID['prof'],    False)
                 self.popupMenu.Enable(self.popupID['meta'],    False)
                 self.popupMenu.Enable(self.popupID['nviz'],    False)
@@ -535,6 +538,12 @@
 
         return True
 
+    def OnUnivariateStats(self, event):
+        """!Univariate raster statistics"""
+        name = self.GetPyData(self.layer_selected)[0]['maplayer'].GetName()
+        menuform.GUI(parent = self).ParseCommand(['r.univar',
+                                                  'map=%s' % name])
+
     def OnStartEditing(self, event):
         """!Start editing vector map layer requested by the user
         """



More information about the grass-commit mailing list