Pārlūkot izejas kodu

wxGUI: fix rendering - skip map layers which haven't been rendered successfully

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@51694 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 13 gadi atpakaļ
vecāks
revīzija
5ef6dbeb5c
1 mainītis faili ar 13 papildinājumiem un 1 dzēšanām
  1. 13 1
      gui/wxpython/core/render.py

+ 13 - 1
gui/wxpython/core/render.py

@@ -9,7 +9,7 @@ Classes:
  - render::Overlay
  - render::Map
 
-(C) 2006-2011 by the GRASS Development Team
+(C) 2006-2012 by the GRASS Development Team
 
 This program is free software under the GNU General Public License
 (>=v2). Read the file COPYING that comes with GRASS for details.
@@ -861,6 +861,14 @@ class Map(object):
         return selected
 
     def _renderLayers(self, force = False, mapWindow = None, overlaysOnly = False):
+        """!Render all map layers into files
+
+        @param force True to force rendering
+        @param mapWindow GUI window or None (statusbar/progress bar)
+        @param overlaysOnly True to render only overlays
+
+        @return list of maps, masks and opacities
+        """
         maps = list()
         masks = list()
         opacities = list()
@@ -887,6 +895,10 @@ class Map(object):
                 event = wxUpdateProgressBar(value = ilayer)
                 wx.PostEvent(mapWindow, event)
             
+            # skip map layers when rendering fails
+            if not os.path.exists(layer.mapfile):
+                continue
+            
             # add image to compositing list
             if layer.type != "overlay":
                 maps.append(layer.mapfile)