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

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Aug 30 17:01:25 EDT 2011


Author: martinl
Date: 2011-08-30 14:01:25 -0700 (Tue, 30 Aug 2011)
New Revision: 47989

Modified:
   grass/trunk/gui/wxpython/gui_modules/render.py
   grass/trunk/gui/wxpython/gui_modules/workspace.py
Log:
wxGUI: minor changes in AlignExtentFromDisplay


Modified: grass/trunk/gui/wxpython/gui_modules/render.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/render.py	2011-08-30 20:34:35 UTC (rev 47988)
+++ grass/trunk/gui/wxpython/gui_modules/render.py	2011-08-30 21:01:25 UTC (rev 47989)
@@ -499,8 +499,9 @@
         nwres = ewres = 0.0
         
         # Get current values for region and display
-        nsres = self.GetRegion()['nsres']
-        ewres = self.GetRegion()['ewres']
+        reg = self.GetRegion()
+        nsres = reg['nsres']
+        ewres = reg['ewres']
         
         n = float(self.region['n'])
         s = float(self.region['s'])
@@ -512,15 +513,16 @@
         new['cols'] = math.fabs(round((e-w)/ewres))
         
         # Calculate new extents
-        new['s'] = nsres * round(s/nsres)
-        new['w'] = ewres * round(w/ewres)
+        new['s'] = nsres * round(s / nsres)
+        new['w'] = ewres * round(w / ewres)
         new['n'] = new['s'] + (new['rows'] * nsres)
         new['e'] = new['w'] + (new['cols'] * ewres)
         
         return new
 
     def AlignExtentFromDisplay(self):
-        """!Align region extent based on display size from center point"""
+        """!Align region extent based on display size from center
+        point"""
         # calculate new bounding box based on center of display
         if self.region["ewres"] > self.region["nsres"]:
             res = self.region["ewres"]
@@ -541,10 +543,8 @@
         
         # LL locations
         if self.projinfo['proj'] == 'll':
-            if self.region['n'] > 90.0:
-                self.region['n'] = 90.0
-            if self.region['s'] < -90.0:
-                self.region['s'] = -90.0
+            self.region['n'] = min(self.region['n'], 90.0)
+            self.region['s'] = max(self.region['s'], -90.0)
         
     def _writeEnvFile(self, data):
         """!Write display-related variable to the file (used for

Modified: grass/trunk/gui/wxpython/gui_modules/workspace.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/workspace.py	2011-08-30 20:34:35 UTC (rev 47988)
+++ grass/trunk/gui/wxpython/gui_modules/workspace.py	2011-08-30 21:01:25 UTC (rev 47989)
@@ -930,7 +930,7 @@
                                               region['e'],
                                               region['n'],
                                               viewmode
-                                                    ))
+                                              ))
             # projection statusbar info
             if mapTree.mapdisplay.statusbarWin['projection'].IsChecked() and \
                     UserSettings.Get(group='display', key='projection', subkey='proj4'):



More information about the grass-commit mailing list