[GRASS-SVN] r41861 - in grass/trunk: raster/r.grow.distance
scripts/r.buffer
svn_grass at osgeo.org
svn_grass at osgeo.org
Wed Apr 14 10:33:27 EDT 2010
Author: martinl
Date: 2010-04-14 10:33:27 -0400 (Wed, 14 Apr 2010)
New Revision: 41861
Modified:
grass/trunk/raster/r.grow.distance/main.c
grass/trunk/scripts/r.buffer/r.buffer.py
Log:
r.buffer/r.grow.distance: be more verbose
Modified: grass/trunk/raster/r.grow.distance/main.c
===================================================================
--- grass/trunk/raster/r.grow.distance/main.c 2010-04-14 14:03:56 UTC (rev 41860)
+++ grass/trunk/raster/r.grow.distance/main.c 2010-04-14 14:33:27 UTC (rev 41861)
@@ -1,7 +1,7 @@
/****************************************************************************
*
- * MODULE: r.grow2
+ * MODULE: r.grow.distance
*
* AUTHOR(S): Marjorie Larson - CERL
* Glynn Clements
@@ -9,7 +9,7 @@
* PURPOSE: Generates a raster map layer with contiguous areas
* grown by one cell.
*
- * COPYRIGHT: (C) 2006 by the GRASS Development Team
+ * COPYRIGHT: (C) 2006, 2010 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
@@ -147,8 +147,9 @@
module = G_define_module();
G_add_keyword(_("raster"));
+ G_add_keyword(_("distance"));
module->description =
- _("Generates a raster map layer of distance to features in input layer.");
+ _("Generates a raster map of distance to features in input raster map.");
opt.in = G_define_standard_option(G_OPT_R_INPUT);
@@ -203,7 +204,7 @@
G_begin_geodesic_distance(a, e2);
}
else
- G_fatal_error(_("Unknown metric: [%s]."), opt.met->answer);
+ G_fatal_error(_("Unknown metric: '%s'"), opt.met->answer);
if (flag.m->answer)
scale = G_database_units_to_meters_factor();
@@ -246,6 +247,7 @@
Rast_set_c_null_value(old_x_row, ncols);
Rast_set_c_null_value(old_y_row, ncols);
+ G_message(_("Reading raster map <%s>..."), opt.in->answer);
for (row = 0; row < nrows; row++) {
int irow = nrows - 1 - row;
@@ -293,6 +295,7 @@
Rast_set_c_null_value(old_x_row, ncols);
Rast_set_c_null_value(old_y_row, ncols);
+ G_message(_("Writing output raster maps..."), opt.in->answer);
for (row = 0; row < nrows; row++) {
int irow = nrows - 1 - row;
off_t offset =
Modified: grass/trunk/scripts/r.buffer/r.buffer.py
===================================================================
--- grass/trunk/scripts/r.buffer/r.buffer.py 2010-04-14 14:03:56 UTC (rev 41860)
+++ grass/trunk/scripts/r.buffer/r.buffer.py 2010-04-14 14:33:27 UTC (rev 41861)
@@ -6,7 +6,7 @@
# AUTHOR(S): Glynn Clements
# PURPOSE: Replacement for r.buffer using r.grow.distance
#
-# COPYRIGHT: (C) 2008 by Glynn Clements
+# COPYRIGHT: (C) 2008, 2010 by Glynn Clements
#
# This program is free software under the GNU General Public
# License (>=v2). Read the file COPYING that comes with GRASS
@@ -15,7 +15,7 @@
#############################################################################
#%Module
-#% description: Creates a raster map layer showing buffer zones surrounding cells that contain non-NULL category values.
+#% description: Creates a raster map showing buffer zones surrounding cells that contain non-NULL category values.
#% keywords: raster
#% keywords: buffer
#%End
@@ -115,6 +115,7 @@
else:
exp = "$temp_src = if(isnull($input),null(),1)"
+ grass.message(_("Extracting buffers (1/2)..."))
grass.mapcalc(exp, temp_src = temp_src, input = input)
exp = "$output = if(!isnull($input),$input,%s)"
@@ -122,6 +123,7 @@
exp %= "if($dist <= %f,%d,%%s)" % (dist2,n + 2)
exp %= "null()"
+ grass.message(_("Extracting buffers (2/2)..."))
grass.mapcalc(exp, output = output, input = temp_src, dist = temp_dist)
p = grass.feed_command('r.category', map = output, rules = '-')
@@ -137,7 +139,7 @@
# write cmd history:
grass.raster_history(output)
-
+
if __name__ == "__main__":
options, flags = grass.parser()
atexit.register(cleanup)
More information about the grass-commit
mailing list