[GRASS-SVN] r37778 - grass-addons/vector/v.autokrige2

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Jun 8 12:08:11 EDT 2009


Author: aghisla
Date: 2009-06-08 12:08:11 -0400 (Mon, 08 Jun 2009)
New Revision: 37778

Modified:
   grass-addons/vector/v.autokrige2/v.autokrige2.py
Log:
only vector maps with points are present in input data list


Modified: grass-addons/vector/v.autokrige2/v.autokrige2.py
===================================================================
--- grass-addons/vector/v.autokrige2/v.autokrige2.py	2009-06-08 15:20:48 UTC (rev 37777)
+++ grass-addons/vector/v.autokrige2/v.autokrige2.py	2009-06-08 16:08:11 UTC (rev 37778)
@@ -57,10 +57,14 @@
     def __getVectors(self, *args, **kwargs):
         """Get list of tables for given location and mapset"""
         vectors = grass.list_grouped('vect')[self.gisenv['MAPSET']]
-        #@TODO: filter maps and drop the vectors without points
+
+        for n in vectors:
+            if grass.vector_info_topo(n)['points'] == 0:
+                vectors.remove(n)
+        
         if vectors == []:
             wx.MessageBox(parent=self,
-                          message=("Unable to get list of vectors. Check if the location is correct."),
+                          message=("No vector maps available. Check if the location is correct."),
                           caption=("Error"), style=wx.OK | wx.ICON_ERROR | wx.CENTRE)
         return sorted(vectors)
 



More information about the grass-commit mailing list