Forráskód Böngészése

v.colors: fix creating column in pg driver (be case-sensitive)

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@63700 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 10 éve
szülő
commit
c804a80484
3 módosított fájl, 11 hozzáadás és 6 törlés
  1. 1 1
      vector/v.colors/main.c
  2. 8 3
      vector/v.colors/v.colors.html
  3. 2 2
      vector/v.colors/write_rgb.c

+ 1 - 1
vector/v.colors/main.c

@@ -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

+ 8 - 3
vector/v.colors/v.colors.html

@@ -38,7 +38,7 @@ items is slow.
 
 <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 @@ Define color table <tt>wave</tt> based on categories from layer 1
 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.to.db map=soils_general layer=1 option=area column=AREA
 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 @@ help people select good color schemes for maps and other graphics.
 
 <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>

+ 2 - 2
vector/v.colors/write_rgb.c

@@ -30,7 +30,7 @@ void write_rgb_values(const struct Map_info *Map, int layer, const char *column_
     
     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 @@ void write_rgb_values(const struct Map_info *Map, int layer, const char *column_
 			     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);