[GRASS-SVN] r64300 - grass/trunk/gui/wxpython/nviz

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Jan 24 09:20:25 PST 2015


Author: annakrat
Date: 2015-01-24 09:20:25 -0800 (Sat, 24 Jan 2015)
New Revision: 64300

Modified:
   grass/trunk/gui/wxpython/nviz/mapwindow.py
Log:
wxGUI/nviz: pass only existing maps for surface/3d raster attributes to avoid crashing

Modified: grass/trunk/gui/wxpython/nviz/mapwindow.py
===================================================================
--- grass/trunk/gui/wxpython/nviz/mapwindow.py	2015-01-24 16:59:51 UTC (rev 64299)
+++ grass/trunk/gui/wxpython/nviz/mapwindow.py	2015-01-24 17:20:25 UTC (rev 64300)
@@ -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