[GRASS-SVN] r67773 - grass/branches/releasebranch_7_0/gui/wxpython/psmap
svn_grass at osgeo.org
svn_grass at osgeo.org
Sun Feb 7 13:58:37 PST 2016
Author: annakrat
Date: 2016-02-07 13:58:37 -0800 (Sun, 07 Feb 2016)
New Revision: 67773
Modified:
grass/branches/releasebranch_7_0/gui/wxpython/psmap/dialogs.py
grass/branches/releasebranch_7_0/gui/wxpython/psmap/utils.py
Log:
wxGUI/psmap: fix #2852 - fit frame to match current region (merge from trunk, r67608)
Modified: grass/branches/releasebranch_7_0/gui/wxpython/psmap/dialogs.py
===================================================================
--- grass/branches/releasebranch_7_0/gui/wxpython/psmap/dialogs.py 2016-02-07 21:56:11 UTC (rev 67772)
+++ grass/branches/releasebranch_7_0/gui/wxpython/psmap/dialogs.py 2016-02-07 21:58:37 UTC (rev 67773)
@@ -1071,15 +1071,8 @@
mapFrameDict['scale'] = self.scale[2]
mapFrameDict['center'] = self.center[2]
+ region = grass.region()
- env = grass.gisenv()
- windFilePath = os.path.join(env['GISDBASE'], env['LOCATION_NAME'], env['MAPSET'], 'WIND')
- try:
- windFile = open(windFilePath, 'r').read()
- region = grass.parse_key_val(windFile, sep = ':', val_type = float)
- except IOError:
- region = grass.region()
-
raster = self.instruction.FindInstructionByType('raster')
if raster:
rasterId = raster.id
@@ -1087,11 +1080,11 @@
rasterId = None
if rasterId: # because of resolution
- RunCommand('g.region', n = region['north'], s = region['south'],
- e = region['east'], w = region['west'], rast = self.instruction[rasterId]['raster'])
+ RunCommand('g.region', n=region['n'], s=region['s'],
+ e=region['e'], w=region['w'], rast=self.instruction[rasterId]['raster'])
else:
- RunCommand('g.region', n = region['north'], s = region['south'],
- e = region['east'], w = region['west'])
+ RunCommand('g.region', n=region['n'], s=region['s'],
+ e=region['e'], w=region['w'])
elif scaleType == 3:
mapFrameDict['drawMap'] = False
Modified: grass/branches/releasebranch_7_0/gui/wxpython/psmap/utils.py
===================================================================
--- grass/branches/releasebranch_7_0/gui/wxpython/psmap/utils.py 2016-02-07 21:56:11 UTC (rev 67772)
+++ grass/branches/releasebranch_7_0/gui/wxpython/psmap/utils.py 2016-02-07 21:58:37 UTC (rev 67773)
@@ -213,16 +213,7 @@
res = grass.read_command("g.region", flags = 'gu', region = region)
currRegionDict = grass.parse_key_val(res, val_type = float)
elif scaleType == 2: # current region
- env = grass.gisenv()
- windFilePath = os.path.join(env['GISDBASE'], env['LOCATION_NAME'], env['MAPSET'], 'WIND')
- try:
- windFile = open(windFilePath, 'r').read()
- except IOError:
- currRegionDict = grass.region()
- regionDict = grass.parse_key_val(windFile, sep = ':', val_type = float)
- region = grass.read_command("g.region", flags = 'gu', n = regionDict['north'], s = regionDict['south'],
- e = regionDict['east'], w = regionDict['west'])
- currRegionDict = grass.parse_key_val(region, val_type = float)
+ currRegionDict = grass.region()
else:
return None, None, None
More information about the grass-commit
mailing list