[GRASS-SVN] r49543 - grass/trunk/vector/v.to.rast
svn_grass at osgeo.org
svn_grass at osgeo.org
Mon Dec 5 05:06:28 EST 2011
Author: martinl
Date: 2011-12-05 02:06:28 -0800 (Mon, 05 Dec 2011)
New Revision: 49543
Modified:
grass/trunk/vector/v.to.rast/support.c
grass/trunk/vector/v.to.rast/vect2rast.c
Log:
v.to.rast: allow `use=cat rgbcolumn=column`
enable warning when rasterization is done
(merge r49541 from devbr6)
Modified: grass/trunk/vector/v.to.rast/support.c
===================================================================
--- grass/trunk/vector/v.to.rast/support.c 2011-12-05 10:01:45 UTC (rev 49542)
+++ grass/trunk/vector/v.to.rast/support.c 2011-12-05 10:06:28 UTC (rev 49543)
@@ -132,6 +132,9 @@
G_fatal_error(_("Unable to open database <%s> by driver <%s>"),
Fi->database, Fi->driver);
+ if (!attr_column)
+ attr_column = Fi->key;
+
/* get number of records in attr_column */
if ((nrec =
db_select_CatValArray(Driver, Fi->table, Fi->key, attr_column, NULL,
Modified: grass/trunk/vector/v.to.rast/vect2rast.c
===================================================================
--- grass/trunk/vector/v.to.rast/vect2rast.c 2011-12-05 10:01:45 UTC (rev 49542)
+++ grass/trunk/vector/v.to.rast/vect2rast.c 2011-12-05 10:06:28 UTC (rev 49543)
@@ -177,6 +177,7 @@
stat = output_raster(fd);
} while (stat == 0);
+ G_suppress_warnings(0);
/* stat: 0 == repeat; 1 == done; -1 == error; */
Vect_destroy_line_struct(Points);
@@ -195,13 +196,14 @@
/* colors */
if (rgbcolumn) {
- if (use != USE_ATTR) {
+ if (use != USE_ATTR && use != USE_CAT) {
G_warning(_("Color can be updated from database only if use=attr"));
update_colors(raster_map);
}
-
- update_dbcolors(raster_map, vector_map, field, rgbcolumn, is_fp,
- column);
+ else {
+ update_dbcolors(raster_map, vector_map, field, rgbcolumn, is_fp,
+ column);
+ }
}
else if (use == USE_D)
update_fcolors(raster_map);
More information about the grass-commit
mailing list