[GRASS-SVN] r32554 - grass/trunk/gui/wxpython/gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Aug 6 02:15:35 EDT 2008


Author: cmbarton
Date: 2008-08-06 02:15:35 -0400 (Wed, 06 Aug 2008)
New Revision: 32554

Modified:
   grass/trunk/gui/wxpython/gui_modules/georect.py
Log:
Added clip to current region checkbox, put GCP management toolbar back in GCP management window, fixed a few minor bugs.

Modified: grass/trunk/gui/wxpython/gui_modules/georect.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/georect.py	2008-08-06 06:15:01 UTC (rev 32553)
+++ grass/trunk/gui/wxpython/gui_modules/georect.py	2008-08-06 06:15:35 UTC (rev 32554)
@@ -672,8 +672,11 @@
         self.SetTarget(self.xygroup, self.currentlocation, self.currentmapset)
 
         #
-        # toolbar
+        # toolbar and display for xy map
         #
+        self.toolbar = toolbars.GCPToolbar(parent=self, tbframe=self).GetToolbar()
+        self.SetToolBar(self.toolbar)
+        
         self.SetMapDisplay(self.mapdisp)
 
         #
@@ -698,6 +701,11 @@
                                        majorDimension=wx.RA_SPECIFY_COLS)
         sizer.Add(item=self.rb_grmethod, proportion=0,
                        flag=wx.EXPAND | wx.ALL, border=5)
+        
+        self.clip_to_region = wx.CheckBox(parent=panel, id=wx.ID_ANY,
+                                label=_("clip to computational region in target location"))
+        sizer.Add(item=self.clip_to_region, proportion=0,
+                       flag=wx.EXPAND | wx.ALL, border=5)
 
         box = wx.StaticBox (parent=panel, id=wx.ID_ANY,
                             label=" %s " % _("Ground Control Points"))
@@ -729,13 +737,8 @@
     def SetMapDisplay(self, win):
         self.mapdisp = win
         if self.mapdisp:
-            self.toolbar = toolbars.GCPToolbar(parent=self, mapdisplay=self.mapdisp, map=self.mapdisp.Map).GetToolbar()
-            self.SetToolBar(self.toolbar)
+             self.list.LoadData()
 
-            self.list.LoadData()
-        else:
-            self.toolbar = None
-
     def SetTarget(self, tgroup, tlocation, tmapset):
         """
         Sets rectification target to current location and mapset
@@ -931,8 +934,9 @@
         #
         # calculate RMS
         #
-        if self.CheckGCPcount():
-            self.RMSError(self.xygroup, self.gr_order)
+        # FIXME auto calculation on load is not working
+        #if self.CheckGCPcount():
+        #    self.RMSError(self.xygroup, self.gr_order)
 
     def ReloadGCPs(self, event):
         """Reload data from file"""
@@ -954,7 +958,7 @@
         are active for the selected transformation order
         """
         if (self.GCPcount < 3 and self.gr_order == 1) or \
-            (self.GCPcount < 6 and self.gr_order == 2) or \
+            (self.GCPcount < 7 and self.gr_order == 2) or \
             (self.GCPcount < 10 and self.gr_order == 3):
             if msg:
                 wx.MessageBox(parent=self,
@@ -962,7 +966,7 @@
                               message=_('Insufficient points defined and active (checked) '
                                         'for selected rectification method.\n'
                                         '3+ points needed for 1st order,\n'
-                                        '6+ points for 2nd order, and\n'
+                                        '7+ points for 2nd order, and\n'
                                         '10+ points for 3rd order.'),
                               style=wx.ICON_INFORMATION | wx.ID_OK | wx.CENTRE)
                 return False
@@ -981,13 +985,13 @@
                 
         if maptype == 'cell':
             self.grwiz.SwitchEnv('new')
+            cmdlist = ['i.rectify','-a','group=%s' % self.xygroup,
+                       'extension=%s' % self.extension,'order=%s' % self.gr_order]
+            if self.clip_to_region:
+                cmdlist.append('-c')
+            
+            self.parent.goutput.RunCmd(cmdlist)
 
-            self.parent.goutput.RunCmd(['i.rectify',
-                                        '-ca',
-                                        'group=%s' % self.xygroup,
-                                        'extension=%s' % self.extension,
-                                        'order=%s' % self.gr_order])
-
             self.grwiz.SwitchEnv('original')
 
         elif maptype == 'vector':



More information about the grass-commit mailing list