[GRASS-SVN] r59404 - grass-addons/grass7/raster/r.stream.order
svn_grass at osgeo.org
svn_grass at osgeo.org
Thu Mar 27 05:29:37 PDT 2014
Author: martinl
Date: 2014-03-27 05:29:36 -0700 (Thu, 27 Mar 2014)
New Revision: 59404
Modified:
grass-addons/grass7/raster/r.stream.order/Makefile
grass-addons/grass7/raster/r.stream.order/io.c
grass-addons/grass7/raster/r.stream.order/io.h
grass-addons/grass7/raster/r.stream.order/local_proto.h
grass-addons/grass7/raster/r.stream.order/local_vars.h
grass-addons/grass7/raster/r.stream.order/main.c
grass-addons/grass7/raster/r.stream.order/stream_init.c
grass-addons/grass7/raster/r.stream.order/stream_order.c
grass-addons/grass7/raster/r.stream.order/stream_raster_close.c
grass-addons/grass7/raster/r.stream.order/stream_topology.c
grass-addons/grass7/raster/r.stream.order/stream_vector.c
Log:
r.stream.order: more guisection, message correction
various minor cosmetics
Modified: grass-addons/grass7/raster/r.stream.order/Makefile
===================================================================
--- grass-addons/grass7/raster/r.stream.order/Makefile 2014-03-27 11:57:00 UTC (rev 59403)
+++ grass-addons/grass7/raster/r.stream.order/Makefile 2014-03-27 12:29:36 UTC (rev 59404)
@@ -11,4 +11,3 @@
include $(MODULE_TOPDIR)/include/Make/Module.make
default: cmd
-
Modified: grass-addons/grass7/raster/r.stream.order/io.c
===================================================================
--- grass-addons/grass7/raster/r.stream.order/io.c 2014-03-27 11:57:00 UTC (rev 59403)
+++ grass-addons/grass7/raster/r.stream.order/io.c 2014-03-27 12:29:36 UTC (rev 59404)
@@ -14,7 +14,7 @@
int r;
if (data_type < 0 || data_type > 2)
- G_fatal_error(_("ram_creat: Cannot create map of unrecognised type"));
+ G_fatal_error(_("Unable to create raster map of unrecognised type"));
map->data_type = data_type;
map->map_name = NULL;
@@ -76,10 +76,10 @@
if (check_res)
if (this_window.ew_res != cellhd.ew_res ||
this_window.ns_res != cellhd.ns_res)
- G_fatal_error(_("Region resolution and map %s resolution differs. \
- Run g.region rast=%s to set proper region resolution"),
- input_map_name, input_map_name);
-
+ G_fatal_error(_("Region resolution and raster map <%s> resolution differs. "
+ "Run 'g.region rast=%s' to set proper region resolution."),
+ input_map_name, input_map_name);
+
/* checking if input map is of required type */
if (check_data_type != map->data_type)
G_debug(1,
@@ -87,7 +87,7 @@
input_data_type = Rast_map_type(input_map_name, mapset);
if (check_data_type != -1)
if (input_data_type != check_data_type)
- G_fatal_error(_("<%s> is not of type %s"),
+ G_fatal_error(_("Raster map <%s> is not of type '%s'"),
input_map_name, maptypes[check_data_type]);
input_map_fd = Rast_open_old(input_map_name, mapset);
@@ -117,7 +117,7 @@
input_buffer = Rast_allocate_buf(input_data_type);
/* start reading */
- G_message(_("Reading map <%s>"), input_map_name);
+ G_message(_("Reading raster map <%s>..."), input_map_name);
for (r = 0; r < map->nrows; ++r) {
G_percent(r, map->nrows, 2);
@@ -145,7 +145,7 @@
input_data_type);
break;
default:
- G_fatal_error(_("ram_open:Wrong internal data type"));
+ G_fatal_error(_("Wrong internal data type"));
break;
}
} /*end for r */
@@ -192,7 +192,7 @@
G_debug(1,
"ram_write:required map type and internal map type differs: conversion forced!");
- G_message(_("Writing map <%s>"), output_map_name);
+ G_message(_("Writing raster map <%s>..."), output_map_name);
output_fd = Rast_open_new(output_map_name, output_data_type);
/* writing */
@@ -218,7 +218,7 @@
Rast_set_d_null_value(row + c * (map->data_size), 1);
break;
default:
- G_debug(1, "ram_null:Cannot convert to null at: %d %d", r, c);
+ G_debug(1, "Unable to convert to NULL at: %d %d", r, c);
}
}
@@ -229,7 +229,7 @@
Rast_short_history(output_map_name, "raster", &history);
Rast_command_history(&history);
Rast_write_history(output_map_name, &history);
- G_message(_("<%s> Done"), output_map_name);
+ /* G_message(_("<%s> Done"), output_map_name); */
return 0;
}
@@ -294,7 +294,7 @@
seg->data_size = sizeof(DCELL);
break;
default:
- G_fatal_error(_("seg_create: unrecognisabe data type"));
+ G_fatal_error(_("Uunrecognisable data type"));
}
filename = G_tempfile();
@@ -305,18 +305,18 @@
seg->data_size)) {
close(fd);
unlink(filename);
- G_fatal_error(_("seg_create: cannot format segment"));
+ G_fatal_error(_("Unable to format segment"));
}
close(fd);
if (0 > (fd = open(filename, 2))) {
unlink(filename);
- G_fatal_error(_("seg_create: cannot re-open file"));
+ G_fatal_error(_("Unable re-open file '%s'"), filename);
}
if (0 > (fd = segment_init(&(seg->seg), fd, number_of_segs))) {
unlink(filename);
- G_fatal_error(_("seg_create: cannot init segment file or out of memory"));
+ G_fatal_error(_("Unable to init segment file or out of memory"));
}
seg->filename = G_store(filename);
@@ -351,7 +351,7 @@
/* checking if map exist */
mapset = (char *)G_find_raster2(input_map_name, "");
if (mapset == NULL)
- G_fatal_error(_("seg_read:Raster map <%s> not found"),
+ G_fatal_error(_("Raster map <%s> not found"),
input_map_name);
seg->mapset = mapset;
@@ -363,17 +363,17 @@
if (check_res)
if (this_window.ew_res != cellhd.ew_res ||
this_window.ns_res != cellhd.ns_res)
- G_fatal_error(_("Region resolution and map %s resolution differs. \
- Run g.region rast=%s to set proper region resolution"),
- input_map_name, input_map_name);
-
+ G_fatal_error(_("Region resolution and raster map <%s> resolution differs. "
+ "Run 'g.region rast=%s' to set proper region resolution."),
+ input_map_name, input_map_name);
+
if (check_data_type != seg->data_type)
G_debug(1,
"ram_open:required map type and internal map type differs: conversion forced!");
input_data_type = Rast_map_type(input_map_name, mapset);
if (check_data_type != -1)
if (input_data_type != check_data_type)
- G_fatal_error(_("<%s> is not of type %s"),
+ G_fatal_error(_("Raster map <%s> is not of type '%s'"),
input_map_name, maptypes[check_data_type]);
input_fd = Rast_open_old(input_map_name, mapset);
@@ -401,7 +401,7 @@
/* end opening and checking */
- G_message(_("Reading map <%s>"), input_map_name);
+ G_message(_("Reading raster map <%s>..."), input_map_name);
input_buffer = Rast_allocate_buf(input_data_type);
target_buffer = Rast_allocate_buf(seg->data_type);
@@ -441,7 +441,7 @@
G_free(input_buffer);
G_free(target_buffer);
Rast_close(input_fd);
- G_fatal_error(_("seg_read: Cannot segment put row %d for map %s"),
+ G_fatal_error(_("Unable to segment put row %d for raster map <%s>"),
r, input_map_name);
}
} /* end for row */
@@ -495,7 +495,7 @@
G_debug(1,
"ram_write:required map type and internal map type differs: conversion forced!");
- G_message(_("Writing map <%s>"), output_map_name);
+ G_message(_("Writing raster map <%s>..."), output_map_name);
output_fd = Rast_open_new(output_map_name, output_data_type);
output_buffer = Rast_allocate_buf(output_data_type);
segment_flush(&(seg->seg));
@@ -505,7 +505,7 @@
G_percent(r, seg->nrows, 2);
if (0 > segment_get_row(&(seg->seg), output_buffer, r))
- G_warning(_("seg_write: Cannot segment read row %d for map %s"),
+ G_warning(_("Unable to segment read row %d for raster map <%s>"),
r, output_map_name);
if (convert_to_null) {
@@ -528,7 +528,7 @@
Rast_set_d_null_value(row + c * (seg->data_size), 1);
break;
default:
- G_warning(_("ram_null:Cannot convert to null at: %d %d"), r,
+ G_warning(_("Unable to convert to NULL at: %d %d"), r,
c);
}
}
@@ -541,7 +541,7 @@
Rast_short_history(output_map_name, "raster", &history);
Rast_command_history(&history);
Rast_write_history(output_map_name, &history);
- G_message(_("%s Done"), output_map_name);
+ /* G_message(_("%s Done"), output_map_name); */
return 0;
}
Modified: grass-addons/grass7/raster/r.stream.order/io.h
===================================================================
--- grass-addons/grass7/raster/r.stream.order/io.h 2014-03-27 11:57:00 UTC (rev 59403)
+++ grass-addons/grass7/raster/r.stream.order/io.h 2014-03-27 12:29:36 UTC (rev 59404)
@@ -56,4 +56,3 @@
int seg_reset_map (SEG *, int);
int seg_write_map(SEG *, char *, RASTER_MAP_TYPE, int, double);
int seg_release_map(SEG *);
-
Modified: grass-addons/grass7/raster/r.stream.order/local_proto.h
===================================================================
--- grass-addons/grass7/raster/r.stream.order/local_proto.h 2014-03-27 11:57:00 UTC (rev 59403)
+++ grass-addons/grass7/raster/r.stream.order/local_proto.h 2014-03-27 12:29:36 UTC (rev 59404)
@@ -25,5 +25,3 @@
int ram_create_vector(CELL** streams, CELL** dirs, char* out_vector, int number_of_streams);
int seg_create_vector(SEGMENT* streams, SEGMENT* dirs, char* out_vector, int number_of_streams);
int stream_add_table (int number_of_streams);
-
-
Modified: grass-addons/grass7/raster/r.stream.order/local_vars.h
===================================================================
--- grass-addons/grass7/raster/r.stream.order/local_vars.h 2014-03-27 11:57:00 UTC (rev 59403)
+++ grass-addons/grass7/raster/r.stream.order/local_vars.h 2014-03-27 12:29:36 UTC (rev 59404)
@@ -59,8 +59,3 @@
/* output vector */
GLOBAL struct Map_info Out;
-
-
-
-
-
Modified: grass-addons/grass7/raster/r.stream.order/main.c
===================================================================
--- grass-addons/grass7/raster/r.stream.order/main.c 2014-03-27 11:57:00 UTC (rev 59403)
+++ grass-addons/grass7/raster/r.stream.order/main.c 2014-03-27 12:29:36 UTC (rev 59404)
@@ -1,20 +1,20 @@
/****************************************************************************
*
- * MODULE: r.stream.order
+ * MODULE: r.stream.order
* AUTHOR(S): Jarek Jasiewicz jarekj amu.edu.pl
*
- * PURPOSE: Calculate Strahler's and more streams hierarchy
- * It use r.stream.extract or r.watershed output files:
- * stream, direction, accumulation and elevation.
- * The output are set of raster maps and vector file containing
- * addational stream attributes.
+ * PURPOSE: Calculate Strahler's and more streams hierarchy
+ * It use r.stream.extract or r.watershed output files:
+ * stream, direction, accumulation and elevation.
+ * The output are set of raster maps and vector file containing
+ * addational stream attributes.
*
- * COPYRIGHT: (C) 2009,2010 by the GRASS Development Team
+ * COPYRIGHT: (C) 2009-2014 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
- * for details.
+ * This program is free software under the GNU General Public
+ * License (>=v2). Read the file COPYING that comes with GRASS
+ * for details.
*
*****************************************************************************/
#define MAIN
@@ -29,11 +29,10 @@
{
IO input[] = {
- {"streams", YES, "output of r.stream.extract or r.watershed"},
- {"dirs", YES, "output of r.stream.extract or r.watershed"},
- {"elevation", NO, "any type digital elevation model"},
- {"accum", NO,
- "any type acc map created by r.watershed or used in r.stream.extract"}
+ {"streams", YES, _("Name of input streams raster map")},
+ {"dirs", YES, _("Name of input direction raster map")},
+ {"elevation", NO, _("Name of input elevation raster map")},
+ {"accum", NO, _("Name of input accumulation raster map")}
};
/* add new basic rdering here and in local_vars.h declaration
@@ -43,11 +42,11 @@
* derivative orders (like Scheideggers/Shreve) shall be added only
* to table definition as a formula and to description file. */
IO output[] = {
- {"strahler", NO, "Strahler's stream order"},
- {"horton", NO, "Original Hortons's stream order"},
- {"shreve", NO, "Shereve's stream magnitude"},
- {"hack", NO, "Hack's streams or Gravelius stream hierarchy"},
- {"topo", NO, "Topological dimension of streams"}
+ {"strahler", NO, _("Name for output Strahler's stream order raster map")},
+ {"horton", NO, _("Name for output original Hortons's stream order raster map")},
+ {"shreve", NO, _("Name for output Shereve's stream magnitude raster map")},
+ {"hack", NO, _("Name for outut Hack's streams or Gravelius stream hierarchy raster map")},
+ {"topo", NO, _("Name for output topological dimension of streams raster map")}
};
struct GModule *module; /* GRASS module for parsing arguments */
@@ -58,7 +57,7 @@
struct Flag *flag_zerofill, *flag_accum, *flag_segmentation;
int output_num = 0;
- int num_seg; /* number of segments */
+ /* int num_seg; */ /* number of segments */
int segmentation, zerofill;
int i; /* iteration vars */
int number_of_segs;
@@ -70,28 +69,27 @@
G_gisinit(argv[0]);
module = G_define_module();
+ module->label = _("Calculates Strahler's and more streams hierarchy.");
module->description =
- _("Calculate Strahler's and more streams hierarchy. Basic module for topological analysis of drainage network");
+ _("Basic module for topological analysis of drainage network.");
G_add_keyword(_("raster"));
G_add_keyword(_("hydrology"));
- G_add_keyword("Strahler stream order");
- G_add_keyword("Hack streams");
- G_add_keyword("Stream network topology");
- G_add_keyword("Stream network geometry");
- G_add_keyword("Network vectorisation");
+ G_add_keyword(_("stream network"));
+ G_add_keyword(_("stream order"));
for (i = 0; i < input_size; ++i) {
opt_input[i] = G_define_standard_option(G_OPT_R_INPUT);
opt_input[i]->key = input[i].name;
opt_input[i]->required = input[i].required;
opt_input[i]->description = _(input[i].description);
+ opt_input[i]->guisection = _("Input");
}
opt_vector = G_define_standard_option(G_OPT_V_OUTPUT);
opt_vector->key = "vector";
opt_vector->required = NO;
opt_vector->description =
- _("OUTPUT vector file to write stream atributes");
+ _("Name for output vector map to write stream atributes");
opt_vector->guisection = _("Output");
for (i = 0; i < orders_size; ++i) {
@@ -107,7 +105,7 @@
opt_swapsize->type = TYPE_INTEGER;
opt_swapsize->answer = "300";
opt_swapsize->description = _("Max memory used in memory swap mode (MB)");
- opt_swapsize->guisection = _("Optional");
+ opt_swapsize->guisection = _("Memory settings");
flag_zerofill = G_define_flag();
flag_zerofill->key = 'z';
@@ -117,6 +115,7 @@
flag_segmentation = G_define_flag();
flag_segmentation->key = 'm';
flag_segmentation->description = _("Use memory swap (operation is slow)");
+ flag_segmentation->guisection = _("Memory settings");
flag_accum = G_define_flag();
flag_accum->key = 'a';
@@ -138,21 +137,19 @@
if (use_vector)
if (!opt_input[o_elev]->answer || !opt_input[o_accum]->answer)
- G_fatal_error(_("To calculate vector file both accum and elev are required"));
+ G_fatal_error(_("To calculate vector map both accumulation and elevation raster maps are required"));
if (use_accum)
if (!opt_input[o_accum]->answer)
- G_fatal_error(_("with -a (use accumulation) accum map is required"));
+ G_fatal_error(_("Flag -a (use accumulation) accumulation raster map is required"));
for (i = 0; i < orders_size; ++i) {
if (!opt_output[i]->answer)
continue;
- if (G_legal_filename(opt_output[i]->answer) < 0)
- G_fatal_error(_("<%s> is an illegal file name"),
- opt_output[i]->answer);
output_num++;
} /* end for */
+
if (!output_num && !opt_vector->answer)
- G_fatal_error(_("You must select one or more output orders maps or insert the table name"));
+ G_fatal_error(_("You must select one or more output orders raster maps or insert the table name"));
/* start */
in_streams = opt_input[o_streams]->answer;
@@ -170,7 +167,7 @@
/* ALL IN RAM VERSION */
if (!segmentation) {
- G_message("ALL IN RAM CALCULATION");
+ G_message(_("All in RAM calculation..."));
MAP map_streams, map_dirs;
CELL **streams, **dirs;
@@ -224,7 +221,7 @@
/* SEGMENTATION VERSION */
if (segmentation) {
- G_message("MEMORY SWAP CALCULATION: MAY TAKE SOME TIME!");
+ G_message(_("Memory swap calculation (may take some time)..."));
SEG map_streams, map_dirs;
SEGMENT *streams, *dirs;
Modified: grass-addons/grass7/raster/r.stream.order/stream_init.c
===================================================================
--- grass-addons/grass7/raster/r.stream.order/stream_init.c 2014-03-27 11:57:00 UTC (rev 59403)
+++ grass-addons/grass7/raster/r.stream.order/stream_init.c 2014-03-27 12:29:36 UTC (rev 59404)
@@ -5,9 +5,9 @@
int number_of_streams = max_index_of_stream;
if (max_index_of_stream == 0)
- G_fatal_error(_("Empty stream input map: check if a stream map"));
+ G_fatal_error(_("Empty stream input raster map"));
if (min_index_of_stream < 0)
- G_fatal_error(_("Stream map has negative values: check if a stream map"));
+ G_fatal_error(_("Stream map has negative values"));
stream_attributes =
(STREAM *) G_malloc((number_of_streams + 1) * sizeof(STREAM));
Modified: grass-addons/grass7/raster/r.stream.order/stream_order.c
===================================================================
--- grass-addons/grass7/raster/r.stream.order/stream_order.c 2014-03-27 11:57:00 UTC (rev 59403)
+++ grass-addons/grass7/raster/r.stream.order/stream_order.c 2014-03-27 12:29:36 UTC (rev 59404)
@@ -13,7 +13,7 @@
int max_strahler = 0, max_strahler_num;
STREAM *SA = stream_attributes; /* for better code readability */
- G_message(_("Calculating Strahler's stream order ..."));
+ G_message(_("Calculating Strahler's stream order..."));
for (j = 0; j < init_num; ++j) { /* main loop on inits */
@@ -65,7 +65,8 @@
int max_shreve = 0;
STREAM *SA = stream_attributes; /* for better code readability */
- G_message(_("Calculating Shreve's stream magnitude, Scheidegger's consistent integer and Drwal's streams hierarchy (old style) ..."));
+ G_message(_("Calculating Shreve's stream magnitude, "
+ "Scheidegger's consistent integer and Drwal's streams hierarchy (old style)..."));
for (j = 0; j < init_num; ++j) { /* main loop on inits */
@@ -118,7 +119,7 @@
int up_stream = 0;
STREAM *SA = stream_attributes; /* for better code readability */
- G_message(_("Calculating Hortons's stream order ..."));
+ G_message(_("Calculating Hortons's stream order..."));
stack = (int *)G_malloc(stack_max * sizeof(int));
for (j = 0; j < outlet_num; ++j) {
Modified: grass-addons/grass7/raster/r.stream.order/stream_raster_close.c
===================================================================
--- grass-addons/grass7/raster/r.stream.order/stream_raster_close.c 2014-03-27 11:57:00 UTC (rev 59403)
+++ grass-addons/grass7/raster/r.stream.order/stream_raster_close.c 2014-03-27 12:29:36 UTC (rev 59404)
@@ -3,7 +3,9 @@
int zerofill)
{
- G_message("Closing maps...");
+ G_debug(3, "ram_close_raster_order(): number_of_streams=%d", number_of_streams);
+
+ G_message("Writing outpout raster maps...");
int *output_fd;
int r, c, i;
CELL *output_buffer, *streams_buffer;
@@ -56,7 +58,7 @@
Rast_short_history(output_map_names[i], "raster", &history);
Rast_command_history(&history);
Rast_write_history(output_map_names[i], &history);
- G_message(_("%s Done"), output_map_names[i]);
+ /* G_message(_("%s Done"), output_map_names[i]); */
}
G_free(output_fd);
@@ -74,6 +76,8 @@
struct History history;
size_t data_size;
+ G_debug(3, "seg_close_raster_order(): number_of_streams=%d", number_of_streams);
+
output_fd = (int *)G_malloc(orders_size * sizeof(int));
for (i = 0; i < orders_size; ++i) {
if (output_map_names[i] == NULL)
@@ -88,7 +92,7 @@
for (r = 0; r < nrows; ++r) {
if (0 > segment_get_row(streams, streams_buffer, r))
- G_warning(_("seg_write: Cannot segment read row %d for map %s"),
+ G_warning(_("Unable to segment read row %d for raster map <%s>"),
r, output_map_names[i]);
for (i = 0; i < orders_size; ++i) {
@@ -122,7 +126,7 @@
Rast_short_history(output_map_names[i], "raster", &history);
Rast_command_history(&history);
Rast_write_history(output_map_names[i], &history);
- G_message(_("%s Done"), output_map_names[i]);
+ /* G_message(_("%s Done"), output_map_names[i]);*/
}
G_free(output_fd);
Modified: grass-addons/grass7/raster/r.stream.order/stream_topology.c
===================================================================
--- grass-addons/grass7/raster/r.stream.order/stream_topology.c 2014-03-27 11:57:00 UTC (rev 59403)
+++ grass-addons/grass7/raster/r.stream.order/stream_topology.c 2014-03-27 12:29:36 UTC (rev 59404)
@@ -15,10 +15,10 @@
}
if (trib > 5)
- G_fatal_error(_("Error finding nodes. \
- Stream and direction maps probably do not match..."));
+ G_fatal_error(_("Error finding nodes. "
+ "Stream and direction maps probably do not match."));
if (trib > 3)
- G_warning(_("Stream network may be too dense..."));
+ G_warning(_("Stream network may be too dense"));
return trib;
}
@@ -62,8 +62,8 @@
if (cur_stream != next_stream) { /* junction: building topology */
if (outlet_num > (number_of_streams - 1))
- G_fatal_error(_("Error finding nodes. \
- Stream and direction maps probably do not match..."));
+ G_fatal_error(_("Error finding nodes. "
+ "Stream and direction maps probably do not match."));
SA[cur_stream].stream = cur_stream;
SA[cur_stream].next_stream = next_stream;
@@ -74,8 +74,8 @@
if (trib_num == 0) { /* is init */
if (init_num > (number_of_streams - 1))
- G_fatal_error(_("Error finding nodes. \
- Stream and direction maps probably do not match..."));
+ G_fatal_error(_("Error finding nodes. "
+ "Stream and direction maps probably do not match."));
SA[cur_stream].trib_num = 0;
init_cells[init_num] = r * ncols + c;
@@ -87,8 +87,8 @@
for (i = 1; i < 9; ++i) {
if (trib > 4)
- G_fatal_error(_("Error finding nodes. \
- Stream and direction maps probably do not match..."));
+ G_fatal_error(_("Error finding nodes. "
+ "Stream and direction maps probably do not match."));
if (NOT_IN_REGION(i))
continue;
j = DIAG(i);
@@ -222,10 +222,10 @@
}
if (trib > 5)
- G_fatal_error(_("Error finding nodes. \
- Stream and direction maps probably do not match..."));
+ G_fatal_error(_("Error finding nodes. "
+ "Stream and direction maps probably do not match."));
if (trib > 3)
- G_warning(_("Stream network may be too dense..."));
+ G_warning(_("Stream network may be too dense"));
return trib;
}
@@ -280,8 +280,8 @@
if (cur_stream != next_stream) { /* junction: building topology */
if (outlet_num > (number_of_streams - 1))
- G_fatal_error(_("Error finding nodes. \
- Stream and direction maps probably do not match..."));
+ G_fatal_error(_("Error finding nodes. "
+ "Stream and direction maps probably do not match."));
SA[cur_stream].stream = cur_stream;
SA[cur_stream].next_stream = next_stream;
@@ -292,8 +292,8 @@
if (trib_num == 0) { /* is init */
if (init_num > (number_of_streams - 1))
- G_fatal_error(_("Error finding nodes. \
- Stream and direction maps probably do not match..."));
+ G_fatal_error(_("Error finding nodes. "
+ "Stream and direction maps probably do not match."));
SA[cur_stream].trib_num = 0;
init_cells[init_num] = r * ncols + c;
@@ -306,8 +306,8 @@
for (i = 1; i < 9; ++i) {
if (trib > 4)
- G_fatal_error(_("Error finding nodes. \
- Stream and direction maps probably do not match..."));
+ G_fatal_error(_("Error finding nodes. "
+ "Stream and direction maps probably do not match."));
if (NOT_IN_REGION(i))
continue;
j = DIAG(i);
@@ -426,6 +426,6 @@
} /* end if */
} /* end while */
} /* end for s */
- G_percent(s, init_num, 2);
+ G_percent(1, 1, 1);
return 0;
}
Modified: grass-addons/grass7/raster/r.stream.order/stream_vector.c
===================================================================
--- grass-addons/grass7/raster/r.stream.order/stream_vector.c 2014-03-27 11:57:00 UTC (rev 59403)
+++ grass-addons/grass7/raster/r.stream.order/stream_vector.c 2014-03-27 12:29:36 UTC (rev 59404)
@@ -75,7 +75,7 @@
/* build vector after adding table */
if (0 < stream_add_table(number_of_streams))
- G_warning(_("Cannot add table to vector %s"), out_vector);
+ G_warning(_("Unable to add attribute table to vector map <%s>"), out_vector);
Vect_hist_command(&Out);
Vect_build(&Out);
Vect_close(&Out);
@@ -167,7 +167,7 @@
/* build vector after adding table */
if (0 < stream_add_table(number_of_streams))
- G_warning(_("Cannot add table to vector %s"), out_vector);
+ G_warning(_("Unable to add attribute table to vector map <%s>"), out_vector);
Vect_hist_command(&Out);
Vect_build(&Out);
Vect_close(&Out);
@@ -246,14 +246,14 @@
"prev_str01 integer, prev_str02 integer, prev_str03 integer, prev_str04 integer, prev_str05 integer";
break;
default:
- G_fatal_error("Error with number of tributuaries");
+ G_fatal_error(_("Error with number of tributuaries"));
break;
}
- sprintf(buf, "create table %s (%s, %s, %s, %s, %s, \
- %s, %s, %s, %s, %s, \
- %s, %s, %s, %s, %s, \
- %s, %s, %s)", Fi->table, tab_cat_col_name, /* 1 */
+ sprintf(buf, "create table %s (%s, %s, %s, %s, %s,"
+ "%s, %s, %s, %s, %s,"
+ "%s, %s, %s, %s, %s,"
+ "%s, %s, %s)", Fi->table, tab_cat_col_name, /* 1 */
tab_stream, tab_next_stream, tab_prev_streams, tab_orders, /* 5 */
tab_scheidegger, tab_drwal_old, tab_length, tab_stright, tab_sinusoid, /* 10 */
tab_cumlength, tab_accum, tab_distance, tab_elev_init, tab_elev_outlet, /* 15 */
@@ -265,16 +265,16 @@
if (db_execute_immediate(driver, &db_sql) != DB_OK) {
db_close_database(driver);
db_shutdown_driver(driver);
- G_warning("Cannot create table %s", db_get_string(&db_sql));
+ G_warning("Unable to create table <%s>", db_get_string(&db_sql));
return -1;
}
if (db_create_index2(driver, Fi->table, cat_col_name) != DB_OK)
- G_warning(_("cannot create index on table %s"), Fi->table);
+ G_warning(_("Unable to create index on table <%s>"), Fi->table);
if (db_grant_on_table(driver, Fi->table,
DB_PRIV_SELECT, DB_GROUP | DB_PUBLIC) != DB_OK) {
- G_warning(_("cannot grant privileges on table %s"), Fi->table);
+ G_warning(_("Unable to grant privileges on table <%s>"), Fi->table);
return -1;
}
db_begin_transaction(driver);
@@ -325,7 +325,7 @@
SA[i].trib[4]);
break;
default:
- G_fatal_error("Error with number of tributuaries");
+ G_fatal_error(_("Error with number of tributuaries"));
break;
}
@@ -333,10 +333,10 @@
all_orders[0][i], all_orders[1][i],
all_orders[2][i], all_orders[3][i], all_orders[4][i]);
- sprintf(buf, "insert into %s values( %d, %d, %d, %s, %s, \
- %d, %d, %f, %f, %f, \
- %f, %f, %f, %f, %f, \
- %f, %f, %f)", Fi->table, i, /* 1 */
+ sprintf(buf, "insert into %s values( %d, %d, %d, %s, %s, "
+ "%d, %d, %f, %f, %f, "
+ "%f, %f, %f, %f, %f, "
+ "%f, %f, %f)", Fi->table, i, /* 1 */
SA[i].stream, SA[i].next_stream, ins_prev_streams, /* buffer created before */
insert_orders, /* 5 *//* buffer created before */
scheidegger, drwal_old, SA[i].length, SA[i].stright, sinusoid, /* 10 */
@@ -349,7 +349,7 @@
if (db_execute_immediate(driver, &db_sql) != DB_OK) {
db_close_database(driver);
db_shutdown_driver(driver);
- G_warning(_("Cannot inset new row: %s"), db_get_string(&db_sql));
+ G_warning(_("Unable to inset new row: '%s'"), db_get_string(&db_sql));
return -1;
}
} /* end for */
More information about the grass-commit
mailing list