[GRASS-SVN] r63700 - grass/trunk/vector/v.colors

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Dec 24 02:19:22 PST 2014


Author: martinl
Date: 2014-12-24 02:19:22 -0800 (Wed, 24 Dec 2014)
New Revision: 63700

Modified:
   grass/trunk/vector/v.colors/main.c
   grass/trunk/vector/v.colors/v.colors.html
   grass/trunk/vector/v.colors/write_rgb.c
Log:
v.colors: fix creating column in pg driver (be case-sensitive)


Modified: grass/trunk/vector/v.colors/main.c
===================================================================
--- grass/trunk/vector/v.colors/main.c	2014-12-24 10:05:57 UTC (rev 63699)
+++ grass/trunk/vector/v.colors/main.c	2014-12-24 10:19:22 UTC (rev 63700)
@@ -7,7 +7,7 @@
  *               
  * PURPOSE:      Manage color tables for vector maps
  *               
- * COPYRIGHT:    (C) 2011 by the GRASS Development Team
+ * COPYRIGHT:    (C) 2011-2014 by the GRASS Development Team
  *
  *               This program is free software under the GNU General
  *               Public License (>=v2). Read the file COPYING that

Modified: grass/trunk/vector/v.colors/v.colors.html
===================================================================
--- grass/trunk/vector/v.colors/v.colors.html	2014-12-24 10:05:57 UTC (rev 63699)
+++ grass/trunk/vector/v.colors/v.colors.html	2014-12-24 10:19:22 UTC (rev 63700)
@@ -38,7 +38,7 @@
 
 <h2>EXAMPLES</h2>
 
-<h3>Define color table</h3>
+<h3>Define color table based on categories</h3>
 
 Define color table <tt>wave</tt> based on categories from layer 1
 
@@ -46,6 +46,8 @@
 v.colors map=soils_general layer=1 color=wave
 </pre></div>
 
+<h3>Define color table based on attribute values</h3>
+
 Define color table <tt>ryg</tt> based on values from attribute
 column <tt>AREA</tt>. Attribute table is linked to layer 1.
 
@@ -54,6 +56,8 @@
 v.colors map=soils_general layer=1 color=wave use=attr column=AREA
 </pre></div>
 
+<h3>Define color table stored as RGB values in attribute table</h3>
+  
 Write color values to the attribute table (column <tt>GRASSRGB</tt>)
 instead of creating color table.
 
@@ -127,6 +131,7 @@
 
 <h2>AUTHORS</h2>
 
-Martin Landa, Czech Technical University in Prague, Czech Republic
+Martin Landa, OSGeoREL, Czech Technical University in Prague, Czech Republic
 
-<p><i>Last changed: $Date$</i>
+<p>
+<i>Last changed: $Date$</i>

Modified: grass/trunk/vector/v.colors/write_rgb.c
===================================================================
--- grass/trunk/vector/v.colors/write_rgb.c	2014-12-24 10:05:57 UTC (rev 63699)
+++ grass/trunk/vector/v.colors/write_rgb.c	2014-12-24 10:19:22 UTC (rev 63700)
@@ -30,7 +30,7 @@
     
     ctype = db_column_Ctype(driver, fi->table, column_name);
     if (ctype == -1) {
-	sprintf(buf, "ALTER TABLE %s ADD COLUMN %s VARCHAR(11)",
+	sprintf(buf, "ALTER TABLE \"%s\" ADD COLUMN \"%s\" VARCHAR(11)",
 		fi->table, column_name);
 	db_set_string(&stmt, buf);
 	if (db_execute_immediate(driver, &stmt) != DB_OK)
@@ -77,7 +77,7 @@
 			     colors) == 0)
 	    G_warning(_("No color value defined for category %d"), pval[i]);
 
-	sprintf(buf, "UPDATE %s SET %s='%d:%d:%d' WHERE %s=%d", fi->table,
+	sprintf(buf, "UPDATE \"%s\" SET \"%s\"='%d:%d:%d' WHERE %s=%d", fi->table,
 		   column_name, red, grn, blu, fi->key, pval[i]);
 	G_debug(3, "\tSQL: %s", buf);
 



More information about the grass-commit mailing list