[GRASS-SVN] r64301 - grass/branches/releasebranch_7_0/gui/wxpython/nviz

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Jan 24 09:21:49 PST 2015


Author: annakrat
Date: 2015-01-24 09:21:49 -0800 (Sat, 24 Jan 2015)
New Revision: 64301

Modified:
   grass/branches/releasebranch_7_0/gui/wxpython/nviz/mapwindow.py
Log:
wxGUI/nviz: pass only existing maps for surface/3d raster attributes to avoid crashing (merge from trunk, r64300)

Modified: grass/branches/releasebranch_7_0/gui/wxpython/nviz/mapwindow.py
===================================================================
--- grass/branches/releasebranch_7_0/gui/wxpython/nviz/mapwindow.py	2015-01-24 17:20:25 UTC (rev 64300)
+++ grass/branches/releasebranch_7_0/gui/wxpython/nviz/mapwindow.py	2015-01-24 17:21:49 UTC (rev 64301)
@@ -1917,9 +1917,11 @@
                 elif attrb ==  'transp':
                     self._display.UnsetSurfaceTransp(id) 
             else:
-                if type(value) == types.StringType and \
-                        len(value) <=  0: # ignore empty values (TODO: warning)
-                    continue
+                if type(value) == types.StringType:
+                    if len(value) == 0:  # ignore empty values (TODO: warning)
+                        continue
+                    if map and not grass.find_file(value, element='cell')['fullname']:
+                        continue
                 if attrb ==  'color':
                     self._display.SetSurfaceColor(id, map, str(value))
                 elif attrb ==  'mask':
@@ -2025,9 +2027,11 @@
                     elif attrb ==  'transp':
                         self._display.UnsetIsosurfaceTransp(id, isosurfId) 
                 else:
-                    if type(value) == types.StringType and \
-                            len(value) <=  0: # ignore empty values (TODO: warning)
-                        continue
+                    if type(value) == types.StringType:
+                        if len(value) == 0:  # ignore empty values (TODO: warning)
+                            continue
+                        if map and not grass.find_file(value, element='grid3')['fullname']:
+                            continue
                     elif attrb ==  'color':
                         self._display.SetIsosurfaceColor(id, isosurfId, map, str(value))
                     elif attrb ==  'mask':



More information about the grass-commit mailing list