[GRASS-SVN] r35366 - grass/trunk/vector/v.to.rast
svn_grass at osgeo.org
svn_grass at osgeo.org
Mon Jan 12 10:03:53 EST 2009
Author: martinl
Date: 2009-01-12 10:03:53 -0500 (Mon, 12 Jan 2009)
New Revision: 35366
Modified:
grass/trunk/vector/v.to.rast/do_areas.c
grass/trunk/vector/v.to.rast/do_lines.c
grass/trunk/vector/v.to.rast/main.c
grass/trunk/vector/v.to.rast/raster.c
grass/trunk/vector/v.to.rast/vect2rast.c
Log:
v.to.rast: be more verbose (percentage information)
(merge from relbr64, r35364)
Modified: grass/trunk/vector/v.to.rast/do_areas.c
===================================================================
--- grass/trunk/vector/v.to.rast/do_areas.c 2009-01-12 14:57:05 UTC (rev 35365)
+++ grass/trunk/vector/v.to.rast/do_areas.c 2009-01-12 15:03:53 UTC (rev 35366)
@@ -30,9 +30,11 @@
if (nareas <= 0)
return 0;
+ G_message(_("Reading areas..."));
for (i = 0; i < nareas; i++) {
/* Note: in old version (grass5.0) there was a check here if the current area
* is identical to previous one. I don't see any reason for this in topological vectors */
+ G_percent(i, nareas, 2);
cat = list[i].cat;
G_debug(3, "Area cat = %d", cat);
@@ -79,7 +81,8 @@
G_plot_polygon(Points->x, Points->y, Points->n_points);
}
-
+ G_percent(1, 1, 1);
+
return nareas;
}
Modified: grass/trunk/vector/v.to.rast/do_lines.c
===================================================================
--- grass/trunk/vector/v.to.rast/do_lines.c 2009-01-12 14:57:05 UTC (rev 35365)
+++ grass/trunk/vector/v.to.rast/do_lines.c 2009-01-12 15:03:53 UTC (rev 35366)
@@ -32,7 +32,9 @@
count = 0;
*count_all = 0;
+ G_message(_("Reading features..."));
for (index = 1; index <= nlines; index++) {
+ G_percent(index, nlines, 2);
type = Vect_read_line(Map, Points, Cats, index);
Vect_cat_get(Cats, field, &cat);
Modified: grass/trunk/vector/v.to.rast/main.c
===================================================================
--- grass/trunk/vector/v.to.rast/main.c 2009-01-12 14:57:05 UTC (rev 35365)
+++ grass/trunk/vector/v.to.rast/main.c 2009-01-12 15:03:53 UTC (rev 35366)
@@ -8,7 +8,7 @@
* Brad Douglas <rez touchofmadness.com>, Glynn Clements <glynn gclements.plus.com>,
* Hamish Bowman <hamish_nospam yahoo.com>, Markus Neteler <neteler itc.it>
* PURPOSE:
- * COPYRIGHT: (C) 2003-2006 by the GRASS Development Team
+ * COPYRIGHT: (C) 2003-2009 by the GRASS Development Team
*
* This program is free software under the GNU General Public
* License (>=v2). Read the file COPYING that comes with GRASS
@@ -37,8 +37,8 @@
module = G_define_module();
module->keywords = _("vector, raster, conversion");
- module->description = _("Converts a binary GRASS vector map layer "
- "into a GRASS raster map layer.");
+ module->description = _("Converts a binary GRASS vector map "
+ "into a GRASS raster map .");
input = G_define_standard_option(G_OPT_V_INPUT);
output = G_define_standard_option(G_OPT_R_OUTPUT);
@@ -136,7 +136,10 @@
value = atof(val_opt->answer);
value_type = (strchr(val_opt->answer, '.')) ? USE_DCELL : USE_CELL;
- return vect_to_rast(input->answer, output->answer, field,
- col->answer, nrows, use, value, value_type,
- rgbcol_opt->answer, label_opt->answer, type);
+ if (vect_to_rast(input->answer, output->answer, field,
+ col->answer, nrows, use, value, value_type,
+ rgbcol_opt->answer, label_opt->answer, type))
+ exit(EXIT_FAILURE);
+
+ exit(EXIT_SUCCESS);
}
Modified: grass/trunk/vector/v.to.rast/raster.c
===================================================================
--- grass/trunk/vector/v.to.rast/raster.c 2009-01-12 14:57:05 UTC (rev 35365)
+++ grass/trunk/vector/v.to.rast/raster.c 2009-01-12 15:03:53 UTC (rev 35366)
@@ -137,6 +137,7 @@
int i;
for (i = 0; i < page.rows; i++, at_row++) {
+ G_percent(i, page.rows, 2);
switch (format) {
case USE_CELL:
cell = raster.cell[i];
@@ -156,7 +157,8 @@
break;
}
}
-
+ G_percent(1, 1, 1);
+
return configure_plot();
}
Modified: grass/trunk/vector/v.to.rast/vect2rast.c
===================================================================
--- grass/trunk/vector/v.to.rast/vect2rast.c 2009-01-12 14:57:05 UTC (rev 35365)
+++ grass/trunk/vector/v.to.rast/vect2rast.c 2009-01-12 15:03:53 UTC (rev 35366)
@@ -33,7 +33,7 @@
nareas = 0;
- G_debug(1, "Loading vector information...");
+ G_message(_("Loading data..."));
Vect_set_open_level(2);
Vect_open_old(&Map, vector_map, "");
@@ -176,11 +176,8 @@
}
}
- G_message(_("Converted areas: %d of %d"), nareas, nareas_all);
- G_message(_("Converted points/lines: %d of %d"), nlines, nplines_all);
+ G_message(_("Writing raster map..."));
- G_debug(1, "Writing raster map ...");
-
stat = output_raster(fd);
} while (stat == 0);
@@ -196,7 +193,7 @@
Vect_close(&Map);
- G_debug(1, "Creating support files for raster map...");
+ G_verbose_message(_("Creating support files for raster map..."));
G_close_cell(fd);
update_hist(raster_map, vector_map, Map.head.orig_scale);
@@ -221,5 +218,10 @@
update_labels(raster_map, vector_map, field, labelcolumn, use, value,
column);
+ G_message(_("Converted areas: %d of %d"), nareas, nareas_all);
+ G_message(_("Converted points/lines: %d of %d"), nlines, nplines_all);
+
+ G_done_msg(" ");
+
return 0;
}
More information about the grass-commit
mailing list