[GRASS-SVN] r51672 - grass/trunk/lib/python/temporal

svn_grass at osgeo.org svn_grass at osgeo.org
Wed May 23 08:29:50 EDT 2012


Author: huhabla
Date: 2012-05-23 05:29:50 -0700 (Wed, 23 May 2012)
New Revision: 51672

Modified:
   grass/trunk/lib/python/temporal/extract.py
   grass/trunk/lib/python/temporal/univar_statistics.py
Log:
Fixed wrong layer handling in vector ids


Modified: grass/trunk/lib/python/temporal/extract.py
===================================================================
--- grass/trunk/lib/python/temporal/extract.py	2012-05-23 12:14:06 UTC (rev 51671)
+++ grass/trunk/lib/python/temporal/extract.py	2012-05-23 12:29:50 UTC (rev 51672)
@@ -83,7 +83,7 @@
 	    dbif.close()
             core.fatal(_("Space time %s dataset <%s> is already in database, use overwrite flag to overwrite") % (type, out_id))
     if type == "vector":
-	rows = sp.get_registered_maps("id,layer", where, "start_time", dbif)
+	rows = sp.get_registered_maps("id,name,mapset,layer", where, "start_time", dbif)
     else:
 	rows = sp.get_registered_maps("id", where, "start_time", dbif)
 
@@ -140,9 +140,9 @@
 		elif type == "vector":
 		    core.verbose(_("Apply v.extract where statement: \"%s\"") % expression)
 		    if row["layer"]:
-			proc_list.append(Process(target=run_vector_extraction, args=(row["id"], map_name, row["layer"], vtype, expression)))
+			proc_list.append(Process(target=run_vector_extraction, args=(row["name"] + "@" + row["mapset"], map_name, row["layer"], vtype, expression)))
 		    else:
-			proc_list.append(Process(target=run_vector_extraction, args=(row["id"], map_name, layer, vtype, expression)))
+			proc_list.append(Process(target=run_vector_extraction, args=(row["name"] + "@" + row["mapset"], map_name, layer, vtype, expression)))
 		
 		proc_list[proc_count].start()
 		proc_count += 1

Modified: grass/trunk/lib/python/temporal/univar_statistics.py
===================================================================
--- grass/trunk/lib/python/temporal/univar_statistics.py	2012-05-23 12:14:06 UTC (rev 51671)
+++ grass/trunk/lib/python/temporal/univar_statistics.py	2012-05-23 12:29:50 UTC (rev 51672)
@@ -60,7 +60,7 @@
 
     if not rows:
         dbif.close()
-        core.fatal(_("Space time %s dataset <%s> is empty") % (sp.get_new_map_instance(None).get_type(), out_id))
+        core.fatal(_("Space time %s dataset <%s> is empty") % (sp.get_new_map_instance(None).get_type(), id))
 
     if header == True:
         print "id" + fs + "start" + fs + "end" + fs + "mean" + fs + "min" + fs + "max" + fs,
@@ -133,11 +133,11 @@
 
     sp.select(dbif)
 
-    rows = sp.get_registered_maps("id,start_time,end_time,layer", twhere, "start_time", dbif)
+    rows = sp.get_registered_maps("id,name,mapset,start_time,end_time,layer", twhere, "start_time", dbif)
 
     if not rows:
         dbif.close()
-        core.fatal(_("Space time %s dataset <%s> is empty") % (sp.get_new_map_instance(None).get_type(), out_id))
+        core.fatal(_("Space time %s dataset <%s> is empty") % (sp.get_new_map_instance(None).get_type(), id))
 
     string = ""
     if header == True:
@@ -153,7 +153,7 @@
 	print string
 
     for row in rows:
-        id = row["id"]
+        id = row["name"] + "@" + row["mapset"]
         start = row["start_time"]
         end = row["end_time"]
 	mylayer = row["layer"]



More information about the grass-commit mailing list