[GRASS-SVN] r53286 - in grass/trunk: lib/python/temporal raster temporal/t.rast.out.vtk

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Sep 28 16:11:38 PDT 2012


Author: huhabla
Date: 2012-09-28 16:11:38 -0700 (Fri, 28 Sep 2012)
New Revision: 53286

Modified:
   grass/trunk/lib/python/temporal/base.py
   grass/trunk/raster/rasterintro.html
   grass/trunk/temporal/t.rast.out.vtk/t.rast.out.vtk.py
Log:
Handle empty maps ids


Modified: grass/trunk/lib/python/temporal/base.py
===================================================================
--- grass/trunk/lib/python/temporal/base.py	2012-09-28 15:37:54 UTC (rev 53285)
+++ grass/trunk/lib/python/temporal/base.py	2012-09-28 23:11:38 UTC (rev 53286)
@@ -660,13 +660,17 @@
            without layer information
 
            @param return the name of the vector map as name at mapset
+                  or None in case the id was not set
         """
-        if self.id.find(":") >= 0:
-            # Remove the layer identifier from the id
-            return self.id.split("@")[0].split(":")[0] + "@" + \
-                   self.id.split("@")[1]
+        if self.id:
+            if self.id.find(":") >= 0:
+                # Remove the layer identifier from the id
+                return self.id.split("@")[0].split(":")[0] + "@" + \
+                       self.id.split("@")[1]
+            else:
+                return self.id
         else:
-            return self.id
+            return None
 
     def get_layer(self):
         """!Convenient method to get the layer of the map (part of primary key)

Modified: grass/trunk/raster/rasterintro.html
===================================================================
--- grass/trunk/raster/rasterintro.html	2012-09-28 15:37:54 UTC (rev 53285)
+++ grass/trunk/raster/rasterintro.html	2012-09-28 23:11:38 UTC (rev 53286)
@@ -135,7 +135,7 @@
 at each region cell's centre.</li>
 <li><a href="r.resamp.bspline.html">r.resamp.bspline</a> Bicubic or bilinear 
 spline interpolation with Tykhonov regularization.</li>
-<li>For <a href="r.resamp.stats.html">r.resamp.stats</a> without <b>-w</b>, the value of 
+<li>For <a href="r.resamp.stats.html">r.resamp.stats</a> without <b>-w</b>, the value of
 each region cell is the chosen aggregate of the values from all of the raster
 cells whose centres fall within the bounds of the region cell.
 <br>

Modified: grass/trunk/temporal/t.rast.out.vtk/t.rast.out.vtk.py
===================================================================
--- grass/trunk/temporal/t.rast.out.vtk/t.rast.out.vtk.py	2012-09-28 15:37:54 UTC (rev 53285)
+++ grass/trunk/temporal/t.rast.out.vtk/t.rast.out.vtk.py	2012-09-28 23:11:38 UTC (rev 53286)
@@ -123,10 +123,8 @@
     if maps is not None:
         for map in maps:
             if use_granularity:
-                if len(map) > 0:
+                if map and len(map) > 0:
                     id = map[0].get_map_id()
-                else:
-                    continue
             else:
                 id = map.get_map_id()
             # None ids will be replaced by NULL maps



More information about the grass-commit mailing list