[GRASS-SVN] r67608 - grass/trunk/gui/wxpython/psmap
svn_grass at osgeo.org
svn_grass at osgeo.org
Mon Jan 18 20:04:23 PST 2016
Author: annakrat
Date: 2016-01-18 20:04:23 -0800 (Mon, 18 Jan 2016)
New Revision: 67608
Modified:
grass/trunk/gui/wxpython/psmap/dialogs.py
grass/trunk/gui/wxpython/psmap/utils.py
Log:
wxGUI/psmap: fix #2852 - fit frame to match current region
Modified: grass/trunk/gui/wxpython/psmap/dialogs.py
===================================================================
--- grass/trunk/gui/wxpython/psmap/dialogs.py 2016-01-19 03:19:32 UTC (rev 67607)
+++ grass/trunk/gui/wxpython/psmap/dialogs.py 2016-01-19 04:04:23 UTC (rev 67608)
@@ -1070,15 +1070,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
@@ -1086,11 +1079,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/trunk/gui/wxpython/psmap/utils.py
===================================================================
--- grass/trunk/gui/wxpython/psmap/utils.py 2016-01-19 03:19:32 UTC (rev 67607)
+++ grass/trunk/gui/wxpython/psmap/utils.py 2016-01-19 04:04:23 UTC (rev 67608)
@@ -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