[GRASS-SVN] r34541 - grass/trunk/scripts/db.in.ogr

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Nov 27 12:17:06 EST 2008


Author: neteler
Date: 2008-11-27 12:17:06 -0500 (Thu, 27 Nov 2008)
New Revision: 34541

Modified:
   grass/trunk/scripts/db.in.ogr/db.in.ogr.py
Log:
untested bugfix (merge from devel_branch6, r34540)

Modified: grass/trunk/scripts/db.in.ogr/db.in.ogr.py
===================================================================
--- grass/trunk/scripts/db.in.ogr/db.in.ogr.py	2008-11-27 17:11:52 UTC (rev 34540)
+++ grass/trunk/scripts/db.in.ogr/db.in.ogr.py	2008-11-27 17:17:06 UTC (rev 34541)
@@ -96,8 +96,10 @@
 
     # rename ID col if requested from cat to new name
     if key:
-	grass.run_command('v.db.renamecol', quiet = True, map = output, layer = 1,
-			  column = (cat, key), stdout = nuldev, stderr = nuldev)
+	grass.run_command('db.execute', quiet = True, flags = 'f',
+			  stdin = "ALTER TABLE %s ADD COLUMN %s integer" % (output, key) )
+	grass.run_command('db.execute', quiet = True, flags = 'f',
+			  stdin = "UPDATE %s SET %s=cat" % (output, key) )
 
     # ... and immediately drop the empty geometry
     vectfile = grass.find_file(output, element = 'vector', mapset = mapset)['file']



More information about the grass-commit mailing list