[GRASS-SVN] r73774 - grass-addons/grass7/vector/v.out.png

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Dec 6 03:09:58 PST 2018


Author: neteler
Date: 2018-12-06 03:09:58 -0800 (Thu, 06 Dec 2018)
New Revision: 73774

Modified:
   grass-addons/grass7/vector/v.out.png/v.out.png.py
Log:
v.out.png addon: run d.info region task initially since it erases the display

Modified: grass-addons/grass7/vector/v.out.png/v.out.png.py
===================================================================
--- grass-addons/grass7/vector/v.out.png/v.out.png.py	2018-12-06 10:55:19 UTC (rev 73773)
+++ grass-addons/grass7/vector/v.out.png/v.out.png.py	2018-12-06 11:09:58 UTC (rev 73774)
@@ -71,6 +71,11 @@
     os.environ['GRASS_RENDER_WIDTH'] = options['width']
     os.environ['GRASS_RENDER_HEIGHT'] = options['height']
 
+    if flags['w']:
+        # get display region info
+        s = grass.read_command('d.info', flags='g')
+        win = grassutils.parse_key_val(s, val_type=float)
+
     monitor_old = None
     genv = gisenv()
     if 'MONITOR' in genv:
@@ -86,11 +91,8 @@
     if monitor_old:
         g.gisenv(set='MONITOR=%s' % monitor_old)
 
-    # get display region info
-    s = grass.read_command('d.info', flags='g')
-    win = grassutils.parse_key_val(s, val_type=float)
-    
     if flags['w']:
+
         wldfile = options['output'].split('.')[0] + '.wld'
         file_ = open(wldfile, "w")
         file_.write("%36.15f \n" % win['ewres'])



More information about the grass-commit mailing list