[GRASS-SVN] r56254 - grass/branches/develbranch_6/vector/v.to.rast
svn_grass at osgeo.org
svn_grass at osgeo.org
Wed May 15 00:39:21 PDT 2013
Author: hamish
Date: 2013-05-15 00:39:21 -0700 (Wed, 15 May 2013)
New Revision: 56254
Modified:
grass/branches/develbranch_6/vector/v.to.rast/support.c
Log:
update history, avoid overflow on long names (#1974)
Modified: grass/branches/develbranch_6/vector/v.to.rast/support.c
===================================================================
--- grass/branches/develbranch_6/vector/v.to.rast/support.c 2013-05-15 00:26:34 UTC (rev 56253)
+++ grass/branches/develbranch_6/vector/v.to.rast/support.c 2013-05-15 07:39:21 UTC (rev 56254)
@@ -22,16 +22,14 @@
if (raster_name == NULL)
return (-1);
- if (G_read_history(raster_name, G_mapset(), &hist) < 0)
- return -1;
+ G_short_history(raster_name, "raster", &hist);
- strcpy(hist.title, raster_name);
+ /* store information from vector map's digit file into history */
+ G_snprintf(hist.datsrc_1, RECORD_LEN-1, "Vector Map: %s in mapset %s",
+ vector_name, vector_mapset);
+ G_snprintf(hist.datsrc_2, RECORD_LEN-1,
+ "Original scale from vector map: 1:%ld", scale); /* 4.0 */
- /* store information from digit file into history */
- sprintf(hist.datsrc_1, "Vector Map: %s in mapset %s", vector_name,
- vector_mapset);
- sprintf(hist.datsrc_2, "Original scale from vector map: 1:%ld", scale); /* 4.0 */
-
/* store command line options */
G_command_history(&hist);
@@ -276,7 +274,7 @@
break;
}
- G_set_raster_cats_title("Labels", &rast_cats);
+ G_set_raster_cats_title("Rasterized vector map from labels", &rast_cats);
/* open vector map and database driver */
Vect_set_open_level(1);
@@ -387,7 +385,7 @@
struct Range range;
map_type = G_raster_map_type(rast_name, G_mapset());
- G_set_raster_cats_title("Values", &rast_cats);
+ G_set_raster_cats_title("Rasterized vector map from values", &rast_cats);
if (map_type == CELL_TYPE) {
CELL min, max;
@@ -426,7 +424,7 @@
if (label_column) {
- G_set_raster_cats_title("Labels", &rast_cats);
+ G_set_raster_cats_title("Rasterized vector map from labels", &rast_cats);
/* open vector map and database driver */
Vect_set_open_level(1);
@@ -516,7 +514,7 @@
G_fatal_error(_("Cannot allocate memory for row buffer"));
G_init_cell_stats(&stats);
- G_set_raster_cats_title("Categories", &rast_cats);
+ G_set_raster_cats_title("Rasterized vector map from categories", &rast_cats);
rows = G_window_rows();
@@ -551,7 +549,8 @@
mapset = G_mapset();
map_type = G_raster_map_type(rast_name, mapset);
- G_set_raster_cats_title("Degrees", &rast_cats);
+ G_set_raster_cats_title("Rasterized vector map from line direction", &rast_cats);
+ G_write_raster_units(rast_name, "degrees CCW from +x");
for (i = 1; i <= 360; i++) {
sprintf(msg, "%d degrees", i);
More information about the grass-commit
mailing list