[GRASS-SVN] r60126 - in grass/trunk/raster: r.stream.channel r.stream.distance r.stream.order r.stream.segment r.stream.snap r.stream.stats
svn_grass at osgeo.org
svn_grass at osgeo.org
Mon May 5 14:47:59 PDT 2014
Author: neteler
Date: 2014-05-05 14:47:59 -0700 (Mon, 05 May 2014)
New Revision: 60126
Modified:
grass/trunk/raster/r.stream.channel/io.c
grass/trunk/raster/r.stream.channel/io.h
grass/trunk/raster/r.stream.channel/stream_topology.c
grass/trunk/raster/r.stream.distance/io.c
grass/trunk/raster/r.stream.distance/io.h
grass/trunk/raster/r.stream.order/io.c
grass/trunk/raster/r.stream.order/io.h
grass/trunk/raster/r.stream.segment/io.c
grass/trunk/raster/r.stream.segment/stream_topology.c
grass/trunk/raster/r.stream.snap/io.c
grass/trunk/raster/r.stream.snap/io.h
grass/trunk/raster/r.stream.stats/io.c
grass/trunk/raster/r.stream.stats/io.h
Log:
r.stream.*: trivial synchronization between cloned files
Modified: grass/trunk/raster/r.stream.channel/io.c
===================================================================
--- grass/trunk/raster/r.stream.channel/io.c 2014-05-05 21:11:32 UTC (rev 60125)
+++ grass/trunk/raster/r.stream.channel/io.c 2014-05-05 21:47:59 UTC (rev 60126)
@@ -76,9 +76,9 @@
if (check_res)
if (this_window.ew_res != cellhd.ew_res ||
this_window.ns_res != cellhd.ns_res)
- 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);
+ 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)
@@ -294,7 +294,7 @@
seg->data_size = sizeof(DCELL);
break;
default:
- G_fatal_error(_("Unrecognisabe data type"));
+ G_fatal_error(_("Unrecognisable data type"));
}
filename = G_tempfile();
@@ -363,9 +363,9 @@
if (check_res)
if (this_window.ew_res != cellhd.ew_res ||
this_window.ns_res != cellhd.ns_res)
- 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);
+ 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,
Modified: grass/trunk/raster/r.stream.channel/io.h
===================================================================
--- grass/trunk/raster/r.stream.channel/io.h 2014-05-05 21:11:32 UTC (rev 60125)
+++ grass/trunk/raster/r.stream.channel/io.h 2014-05-05 21:47:59 UTC (rev 60126)
@@ -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/trunk/raster/r.stream.channel/stream_topology.c
===================================================================
--- grass/trunk/raster/r.stream.channel/stream_topology.c 2014-05-05 21:11:32 UTC (rev 60125)
+++ grass/trunk/raster/r.stream.channel/stream_topology.c 2014-05-05 21:47:59 UTC (rev 60126)
@@ -49,9 +49,9 @@
}
if (trib_num > 5)
- G_fatal_error(_("Error finding inits. Stream and direction maps probably do not match..."));
+ G_fatal_error(_("Error finding inits. Stream and direction maps probably do not match"));
if (trib_num > 3)
- G_warning(_("Stream network may be too dense..."));
+ G_warning(_("Stream network may be too dense"));
return trib_num;
} /* end trib_num */
@@ -87,7 +87,7 @@
stream_attributes =
(STREAM *) G_malloc(number_of_streams * sizeof(STREAM));
- G_message("Finding inits...");
+ G_message(_("Finding inits..."));
SA = stream_attributes;
for (r = 0; r < nrows; ++r)
@@ -95,7 +95,7 @@
if (streams[r][c])
if (ram_trib_nums(r, c, streams, dirs) != 1) { /* adding inits */
if (stream_num > number_of_streams)
- G_fatal_error(_("Error finding inits. Stream and direction maps probably do not match..."));
+ G_fatal_error(_("Error finding inits. Stream and direction maps probably do not match"));
SA[stream_num].stream_num = stream_num;
SA[stream_num].init_r = r;
@@ -170,7 +170,7 @@
SA[i].distance[cell_num] = get_distance(r, c, next_d);
cell_num++;
if (cell_num > SA[i].number_of_cells)
- G_fatal_error(_("To much points in stream line..."));
+ G_fatal_error(_("To many points in stream line"));
} while (streams[r][c] == SA[i].order);
if (SA[i].elevation[0] == -99999)
@@ -180,27 +180,7 @@
return 0;
}
-int ram_find_contributing_cell(int r, int c, CELL **dirs, FCELL **elevation)
-{
- int i, j = 0;
- int next_r, next_c;
- float elev_min = 9999;
- for (i = 1; i < 9; ++i) {
- if (NOT_IN_REGION(i))
- continue;
- next_r = NR(i);
- next_c = NC(i);
- if (dirs[next_r][next_c] == DIAG(i) &&
- elevation[next_r][next_c] < elev_min) {
- elev_min = elevation[next_r][next_c];
- j = i;
- }
- }
-
- return j;
-}
-
int seg_trib_nums(int r, int c, SEGMENT * streams, SEGMENT * dirs)
{ /* calculate number of tributaries */
@@ -282,13 +262,15 @@
G_message("Finding inits...");
SA = stream_attributes;
+ /* finding inits */
for (r = 0; r < nrows; ++r)
for (c = 0; c < ncols; ++c) {
segment_get(streams, &streams_cell, r, c);
+
if (streams_cell)
if (seg_trib_nums(r, c, streams, dirs) != 1) { /* adding inits */
if (stream_num > number_of_streams)
- G_fatal_error(_("Error finding inits. Stream and direction maps probably do not match..."));
+ G_fatal_error(_("Error finding inits. Stream and direction maps probably do not match"));
SA[stream_num].stream_num = stream_num;
SA[stream_num].init_r = r;
@@ -296,6 +278,7 @@
}
}
+ /* building streamline */
for (i = 1; i < stream_num; ++i) {
r = SA[i].init_r;
@@ -303,10 +286,11 @@
segment_get(streams, &(SA[i].order), r, c);
//segment_get(streams,&streams_cell,r,c);
SA[i].number_of_cells = 0;
+
do {
-
SA[i].number_of_cells++;
segment_get(dirs, &dirs_cell, r, c);
+
d = abs(dirs_cell);
if (NOT_IN_REGION(d) || d == 0)
break;
@@ -358,6 +342,7 @@
do {
segment_get(dirs, &dirs_cell, r, c);
d = abs(dirs_cell);
+
if (NOT_IN_REGION(d) || d == 0) {
SA[i].points[cell_num] = -1;
SA[i].distance[cell_num] = SA[i].distance[cell_num - 1];
@@ -386,6 +371,27 @@
return 0;
}
+int ram_find_contributing_cell(int r, int c, CELL **dirs, FCELL **elevation)
+{
+ int i, j = 0;
+ int next_r, next_c;
+ float elev_min = 9999;
+
+ for (i = 1; i < 9; ++i) {
+ if (NOT_IN_REGION(i))
+ continue;
+ next_r = NR(i);
+ next_c = NC(i);
+ if (dirs[next_r][next_c] == DIAG(i) &&
+ elevation[next_r][next_c] < elev_min) {
+ elev_min = elevation[next_r][next_c];
+ j = i;
+ }
+ }
+
+ return j;
+}
+
int seg_find_contributing_cell(int r, int c, SEGMENT *dirs,
SEGMENT *elevation)
{
Modified: grass/trunk/raster/r.stream.distance/io.c
===================================================================
--- grass/trunk/raster/r.stream.distance/io.c 2014-05-05 21:11:32 UTC (rev 60125)
+++ grass/trunk/raster/r.stream.distance/io.c 2014-05-05 21:47:59 UTC (rev 60126)
@@ -14,7 +14,7 @@
int r;
if (data_type < 0 || data_type > 2)
- G_fatal_error(_("Unable to 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;
@@ -47,10 +47,10 @@
RASTER_MAP_TYPE check_data_type)
{
/*
- * Funciton read external map and put it in MAP structure (created with create_map)
- * map: map to be read can be of any data type, read map is converted to target map if neccesary.
+ * Function read external map and put it in MAP structure (created with create_map)
+ * map: map to be read can be of any data type, read map is converted to target map if necessary.
* input_map_name: name of the map to be read;
- * map pointer to map stucture (created with create_map);
+ * map pointer to map structure (created with create_map);
* check_res: [1]: check res correspondence between region and map [0 no check];
* check_data_type [CELL, FCELL, DCELL] check if reading map is of particular type, [-1] no check;
*/
@@ -218,7 +218,7 @@
Rast_set_d_null_value(row + c * (map->data_size), 1);
break;
default:
- G_debug(1, "Cannot Cannot convert to null at: %d %d", r, c);
+ G_debug(1, "ram_null:Cannot convert to null at: %d %d", r, c);
}
}
@@ -329,10 +329,10 @@
{
/*
- * Funciton read external map and put it in SEG structure (created with seg_create_map)
- * map to be read can be of any data type, read map is converted if neccesary.
+ * Function read external map and put it in SEG structure (created with seg_create_map)
+ * map to be read can be of any data type, read map is converted if necessary.
* input_map_name: name of the map to be read;
- * seg: pointer to map stucture (created with create_map);
+ * seg: pointer to map structure (created with create_map);
* check_res: [1]: check res correspondence between region and map [0 no check];
* check_data_type [CELL, FCELL, DCELL] check if reading map is of particular type, [-1] no check;
*/
@@ -359,21 +359,21 @@
G_get_window(&this_window);
Rast_get_cellhd(input_map_name, mapset, &cellhd);
- /* check resolution equal anyinteger check; equal 0 no check */
+ /* check resolution equal any integer check; equal 0 no check */
if (check_res)
if (this_window.ew_res != cellhd.ew_res ||
this_window.ns_res != cellhd.ns_res)
- 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);
-
+ 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(_("Raster <%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);
@@ -528,8 +528,7 @@
Rast_set_d_null_value(row + c * (seg->data_size), 1);
break;
default:
- G_warning(_("Unable to convert to NULL at: %d %d"), r,
- c);
+ G_warning(_("Unable to convert to NULL at: %d %d"), r, c);
}
}
Rast_put_row(output_fd, output_buffer, output_data_type);
Modified: grass/trunk/raster/r.stream.distance/io.h
===================================================================
--- grass/trunk/raster/r.stream.distance/io.h 2014-05-05 21:11:32 UTC (rev 60125)
+++ grass/trunk/raster/r.stream.distance/io.h 2014-05-05 21:47:59 UTC (rev 60126)
@@ -22,7 +22,7 @@
typedef struct {
void **map; /* matrix of data */
- double min, max; /* data range : may requre casting */
+ double min, max; /* data range : may require casting */
int nrows, ncols;
char *map_name; /* map name, unused */
RASTER_MAP_TYPE data_type; /* type of data */
Modified: grass/trunk/raster/r.stream.order/io.c
===================================================================
--- grass/trunk/raster/r.stream.order/io.c 2014-05-05 21:11:32 UTC (rev 60125)
+++ grass/trunk/raster/r.stream.order/io.c 2014-05-05 21:47:59 UTC (rev 60126)
@@ -47,10 +47,10 @@
RASTER_MAP_TYPE check_data_type)
{
/*
- * Funciton read external map and put it in MAP structure (created with create_map)
- * map: map to be read can be of any data type, read map is converted to target map if neccesary.
+ * Function read external map and put it in MAP structure (created with create_map)
+ * map: map to be read can be of any data type, read map is converted to target map if necessary.
* input_map_name: name of the map to be read;
- * map pointer to map stucture (created with create_map);
+ * map pointer to map structure (created with create_map);
* check_res: [1]: check res correspondence between region and map [0 no check];
* check_data_type [CELL, FCELL, DCELL] check if reading map is of particular type, [-1] no check;
*/
@@ -79,7 +79,7 @@
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,
@@ -218,7 +218,7 @@
Rast_set_d_null_value(row + c * (map->data_size), 1);
break;
default:
- G_debug(1, "Unable to convert to NULL at: %d %d", r, c);
+ G_debug(1, "ram_null:Cannot convert to null at: %d %d", r, c);
}
}
@@ -294,7 +294,7 @@
seg->data_size = sizeof(DCELL);
break;
default:
- G_fatal_error(_("Uunrecognisable data type"));
+ G_fatal_error(_("Unrecognisable data type"));
}
filename = G_tempfile();
@@ -311,7 +311,7 @@
close(fd);
if (0 > (fd = open(filename, 2))) {
unlink(filename);
- G_fatal_error(_("Unable re-open file '%s'"), filename);
+ G_fatal_error(_("Unable to re-open file '%s'"), filename);
}
if (0 > (fd = segment_init(&(seg->seg), fd, number_of_segs))) {
@@ -329,10 +329,10 @@
{
/*
- * Funciton read external map and put it in SEG structure (created with seg_create_map)
- * map to be read can be of any data type, read map is converted if neccesary.
+ * Function read external map and put it in SEG structure (created with seg_create_map)
+ * map to be read can be of any data type, read map is converted if necessary.
* input_map_name: name of the map to be read;
- * seg: pointer to map stucture (created with create_map);
+ * seg: pointer to map structure (created with create_map);
* check_res: [1]: check res correspondence between region and map [0 no check];
* check_data_type [CELL, FCELL, DCELL] check if reading map is of particular type, [-1] no check;
*/
@@ -359,14 +359,14 @@
G_get_window(&this_window);
Rast_get_cellhd(input_map_name, mapset, &cellhd);
- /* check resolution equal anyinteger check; equal 0 no check */
+ /* check resolution equal any integer check; equal 0 no check */
if (check_res)
if (this_window.ew_res != cellhd.ew_res ||
this_window.ns_res != cellhd.ns_res)
- 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);
-
+ 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!");
@@ -528,8 +528,7 @@
Rast_set_d_null_value(row + c * (seg->data_size), 1);
break;
default:
- G_warning(_("Unable to convert to NULL at: %d %d"), r,
- c);
+ G_warning(_("Unable to convert to NULL at: %d %d"), r, c);
}
}
Rast_put_row(output_fd, output_buffer, output_data_type);
Modified: grass/trunk/raster/r.stream.order/io.h
===================================================================
--- grass/trunk/raster/r.stream.order/io.h 2014-05-05 21:11:32 UTC (rev 60125)
+++ grass/trunk/raster/r.stream.order/io.h 2014-05-05 21:47:59 UTC (rev 60126)
@@ -22,7 +22,7 @@
typedef struct {
void **map; /* matrix of data */
- double min, max; /* data range : may requre casting */
+ double min, max; /* data range : may require casting */
int nrows, ncols;
char *map_name; /* map name, unused */
RASTER_MAP_TYPE data_type; /* type of data */
Modified: grass/trunk/raster/r.stream.segment/io.c
===================================================================
--- grass/trunk/raster/r.stream.segment/io.c 2014-05-05 21:11:32 UTC (rev 60125)
+++ grass/trunk/raster/r.stream.segment/io.c 2014-05-05 21:47:59 UTC (rev 60126)
@@ -365,7 +365,7 @@
this_window.ns_res != cellhd.ns_res)
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);
+ input_map_name, input_map_name);
if (check_data_type != seg->data_type)
G_debug(1,
@@ -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 */
@@ -528,8 +528,7 @@
Rast_set_d_null_value(row + c * (seg->data_size), 1);
break;
default:
- G_warning(_("Unable to convert to NULL at: %d %d"), r,
- c);
+ G_warning(_("Unable to convert to NULL at: %d %d"), r, c);
}
}
Rast_put_row(output_fd, output_buffer, output_data_type);
Modified: grass/trunk/raster/r.stream.segment/stream_topology.c
===================================================================
--- grass/trunk/raster/r.stream.segment/stream_topology.c 2014-05-05 21:11:32 UTC (rev 60125)
+++ grass/trunk/raster/r.stream.segment/stream_topology.c 2014-05-05 21:47:59 UTC (rev 60126)
@@ -1,4 +1,5 @@
#include "local_proto.h"
+
double get_distance(int r, int c, int d)
{
double northing, easting, next_northing, next_easting;
@@ -10,6 +11,7 @@
easting = window.west + (c + .5) * window.ew_res;
next_northing = window.north - (next_r + .5) * window.ns_res;
next_easting = window.west + (next_c + .5) * window.ew_res;
+
return G_distance(easting, northing, next_easting, next_northing);
}
@@ -47,7 +49,7 @@
}
if (trib_num > 5)
- G_fatal_error(_("Error finding inits. Stream and direction maps probably do not match."));
+ G_fatal_error(_("Error finding inits. Stream and direction maps probably do not match"));
if (trib_num > 3)
G_warning(_("Stream network may be too dense"));
@@ -96,7 +98,7 @@
}
if (trib_num > 5)
- G_fatal_error(_("Error finding inits. Stream and direction maps probably do not match."));
+ G_fatal_error(_("Error finding inits. Stream and direction maps probably do not match"));
if (trib_num > 3)
G_warning(_("Stream network may be too dense"));
@@ -172,7 +174,7 @@
if (streams[r][c])
if (ram_trib_nums(r, c, streams, dirs) != 1) { /* adding inits */
if (stream_num > number_of_streams)
- G_fatal_error(_("Error finding inits. Stream and direction maps probably do not match."));
+ G_fatal_error(_("Error finding inits. Stream and direction maps probably do not match"));
SA[stream_num].stream = stream_num;
SA[stream_num].init = INDEX(r, c);
@@ -251,12 +253,13 @@
SA[i].distance[cell_num] = get_distance(r, c, next_d);
cell_num++;
if (cell_num > SA[i].number_of_cells)
- G_fatal_error(_("To much points in stream line"));
+ G_fatal_error(_("To many points in stream line"));
} while (streams[r][c] == SA[i].order);
if (SA[i].elevation[0] == -99999)
SA[i].elevation[0] = 2 * SA[i].elevation[1] - SA[i].elevation[2];
}
+
return 0;
}
@@ -288,7 +291,7 @@
if (streams_cell)
if (seg_trib_nums(r, c, streams, dirs) != 1) { /* adding inits */
if (stream_num > number_of_streams)
- G_fatal_error(_("Error finding inits. Stream and direction maps probably do not match."));
+ G_fatal_error(_("Error finding inits. Stream and direction maps probably do not match"));
SA[stream_num].stream = stream_num;
SA[stream_num].init = INDEX(r, c);
@@ -306,7 +309,6 @@
SA[i].number_of_cells = 0;
do {
-
SA[i].number_of_cells++;
segment_get(dirs, &dirs_cell, r, c);
@@ -388,6 +390,7 @@
if (SA[i].elevation[0] == -99999)
SA[i].elevation[0] = 2 * SA[i].elevation[1] - SA[i].elevation[2];
}
+
return 0;
}
Modified: grass/trunk/raster/r.stream.snap/io.c
===================================================================
--- grass/trunk/raster/r.stream.snap/io.c 2014-05-05 21:11:32 UTC (rev 60125)
+++ grass/trunk/raster/r.stream.snap/io.c 2014-05-05 21:47:59 UTC (rev 60126)
@@ -47,13 +47,13 @@
RASTER_MAP_TYPE check_data_type)
{
/*
- * Funciton read external map and put it in MAP structure (created with create_map)
- * map: map to be read can be of any data type, read map is converted to target map if neccesary.
+ * Function read external map and put it in MAP structure (created with create_map)
+ * map: map to be read can be of any data type, read map is converted to target map if necessary.
* input_map_name: name of the map to be read;
- * map pointer to map stucture (created with create_map);
+ * map pointer to map structure (created with create_map);
* check_res: [1]: check res correspondence between region and map [0 no check];
* check_data_type [CELL, FCELL, DCELL] check if reading map is of particular type, [-1] no check;
-5 */
+ */
int r, c;
char *mapset;
@@ -329,10 +329,10 @@
{
/*
- * Funciton read external map and put it in SEG structure (created with seg_create_map)
- * map to be read can be of any data type, read map is converted if neccesary.
+ * Function read external map and put it in SEG structure (created with seg_create_map)
+ * map to be read can be of any data type, read map is converted if necessary.
* input_map_name: name of the map to be read;
- * seg: pointer to map stucture (created with create_map);
+ * seg: pointer to map structure (created with create_map);
* check_res: [1]: check res correspondence between region and map [0 no check];
* check_data_type [CELL, FCELL, DCELL] check if reading map is of particular type, [-1] no check;
*/
@@ -359,7 +359,7 @@
G_get_window(&this_window);
Rast_get_cellhd(input_map_name, mapset, &cellhd);
- /* check resolution equal anyinteger check; equal 0 no check */
+ /* check resolution equal any integer check; equal 0 no check */
if (check_res)
if (this_window.ew_res != cellhd.ew_res ||
this_window.ns_res != cellhd.ns_res)
@@ -528,8 +528,7 @@
Rast_set_d_null_value(row + c * (seg->data_size), 1);
break;
default:
- G_warning(_("Unable to convert to NULL at: %d %d"), r,
- c);
+ G_warning(_("Unable to convert to NULL at: %d %d"), r, c);
}
}
Rast_put_row(output_fd, output_buffer, output_data_type);
@@ -541,7 +540,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/trunk/raster/r.stream.snap/io.h
===================================================================
--- grass/trunk/raster/r.stream.snap/io.h 2014-05-05 21:11:32 UTC (rev 60125)
+++ grass/trunk/raster/r.stream.snap/io.h 2014-05-05 21:47:59 UTC (rev 60126)
@@ -22,7 +22,7 @@
typedef struct {
void **map; /* matrix of data */
- double min, max; /* data range : may requre casting */
+ double min, max; /* data range : may require casting */
int nrows, ncols;
char *map_name; /* map name, unused */
RASTER_MAP_TYPE data_type; /* type of data */
Modified: grass/trunk/raster/r.stream.stats/io.c
===================================================================
--- grass/trunk/raster/r.stream.stats/io.c 2014-05-05 21:11:32 UTC (rev 60125)
+++ grass/trunk/raster/r.stream.stats/io.c 2014-05-05 21:47:59 UTC (rev 60126)
@@ -47,10 +47,10 @@
RASTER_MAP_TYPE check_data_type)
{
/*
- * Funciton read external map and put it in MAP structure (created with create_map)
- * map: map to be read can be of any data type, read map is converted to target map if neccesary.
+ * Function read external map and put it in MAP structure (created with create_map)
+ * map: map to be read can be of any data type, read map is converted to target map if necessary.
* input_map_name: name of the map to be read;
- * map pointer to map stucture (created with create_map);
+ * map pointer to map structure (created with create_map);
* check_res: [1]: check res correspondence between region and map [0 no check];
* check_data_type [CELL, FCELL, DCELL] check if reading map is of particular type, [-1] no check;
*/
@@ -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;
}
@@ -329,10 +329,10 @@
{
/*
- * Funciton read external map and put it in SEG structure (created with seg_create_map)
- * map to be read can be of any data type, read map is converted if neccesary.
+ * Function read external map and put it in SEG structure (created with seg_create_map)
+ * map to be read can be of any data type, read map is converted if necessary.
* input_map_name: name of the map to be read;
- * seg: pointer to map stucture (created with create_map);
+ * seg: pointer to map structure (created with create_map);
* check_res: [1]: check res correspondence between region and map [0 no check];
* check_data_type [CELL, FCELL, DCELL] check if reading map is of particular type, [-1] no check;
*/
@@ -359,7 +359,7 @@
G_get_window(&this_window);
Rast_get_cellhd(input_map_name, mapset, &cellhd);
- /* check resolution equal anyinteger check; equal 0 no check */
+ /* check resolution equal any integer check; equal 0 no check */
if (check_res)
if (this_window.ew_res != cellhd.ew_res ||
this_window.ns_res != cellhd.ns_res)
@@ -373,7 +373,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(_("Raster <%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);
@@ -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 */
@@ -528,8 +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,
- c);
+ G_warning(_("Unable to convert to NULL at: %d %d"), r, c);
}
}
Rast_put_row(output_fd, output_buffer, output_data_type);
@@ -541,7 +540,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/trunk/raster/r.stream.stats/io.h
===================================================================
--- grass/trunk/raster/r.stream.stats/io.h 2014-05-05 21:11:32 UTC (rev 60125)
+++ grass/trunk/raster/r.stream.stats/io.h 2014-05-05 21:47:59 UTC (rev 60126)
@@ -22,7 +22,7 @@
typedef struct {
void **map; /* matrix of data */
- double min, max; /* data range : may requre casting */
+ double min, max; /* data range : may require casting */
int nrows, ncols;
char *map_name; /* map name, unused */
RASTER_MAP_TYPE data_type; /* type of data */
More information about the grass-commit
mailing list