[GRASS-SVN] r46409 - grass/trunk/gui/wxpython/gui_modules
svn_grass at osgeo.org
svn_grass at osgeo.org
Tue May 24 10:50:07 EDT 2011
Author: neteler
Date: 2011-05-24 07:50:06 -0700 (Tue, 24 May 2011)
New Revision: 46409
Modified:
grass/trunk/gui/wxpython/gui_modules/layertree.py
Log:
offer univar stats in map menu
Modified: grass/trunk/gui/wxpython/gui_modules/layertree.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/layertree.py 2011-05-24 14:49:29 UTC (rev 46408)
+++ grass/trunk/gui/wxpython/gui_modules/layertree.py 2011-05-24 14:50:06 UTC (rev 46409)
@@ -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', 'sql'):
+ 'color', 'hist', 'univar', 'prof', 'properties', 'sql'):
self.popupID[key] = wx.NewId()
self.popupMenu = wx.Menu()
@@ -400,6 +400,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"))
@@ -410,6 +412,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)
@@ -555,6 +558,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