[GRASS-SVN] r59370 - grass-addons/grass7/raster/r.stream.segment

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Mar 26 08:33:50 PDT 2014


Author: hellik
Date: 2014-03-26 08:33:49 -0700 (Wed, 26 Mar 2014)
New Revision: 59370

Modified:
   grass-addons/grass7/raster/r.stream.segment/io.c
   grass-addons/grass7/raster/r.stream.segment/io.h
   grass-addons/grass7/raster/r.stream.segment/main.c
   grass-addons/grass7/raster/r.stream.segment/r.stream.segment.html
   grass-addons/grass7/raster/r.stream.segment/stream_segment.c
   grass-addons/grass7/raster/r.stream.segment/stream_topology.c
Log:
cosmetics

Modified: grass-addons/grass7/raster/r.stream.segment/io.c
===================================================================
--- grass-addons/grass7/raster/r.stream.segment/io.c	2014-03-26 15:21:32 UTC (rev 59369)
+++ grass-addons/grass7/raster/r.stream.segment/io.c	2014-03-26 15:33:49 UTC (rev 59370)
@@ -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;
      */
@@ -294,7 +294,7 @@
 	seg->data_size = sizeof(DCELL);
 	break;
     default:
-	G_fatal_error(_("seg_create: unrecognisabe data type"));
+	G_fatal_error(_("seg_create: unrecognisable data type"));
     }
 
     filename = G_tempfile();
@@ -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)

Modified: grass-addons/grass7/raster/r.stream.segment/io.h
===================================================================
--- grass-addons/grass7/raster/r.stream.segment/io.h	2014-03-26 15:21:32 UTC (rev 59369)
+++ grass-addons/grass7/raster/r.stream.segment/io.h	2014-03-26 15:33:49 UTC (rev 59370)
@@ -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-addons/grass7/raster/r.stream.segment/main.c
===================================================================
--- grass-addons/grass7/raster/r.stream.segment/main.c	2014-03-26 15:21:32 UTC (rev 59369)
+++ grass-addons/grass7/raster/r.stream.segment/main.c	2014-03-26 15:33:49 UTC (rev 59370)
@@ -5,10 +5,10 @@
  * AUTHOR(S):		 Jarek Jasiewicz jarekj amu.edu.pl
  *							 
  * PURPOSE:			 Calculate geometrical attributes for segments of current order, 
- * 							 divide segments on near stright line portons and 
+ * 							 divide segments on near straight line portions and 
  * 							 and segment orientation and angles between streams and its
- *               tributuaries. For stream direction it use algorithim to divide
- *               particular streams of the same order  into near-stright line
+ *               tributaries. For stream direction it use algorithm to divide
+ *               particular streams of the same order into near-straight line
  *               portions.
  * 				
  *							
@@ -53,7 +53,7 @@
     /* initialize module */
     module = G_define_module();
     module->description =
-	_("Divide network into near strigh-line segments and calculate its order");
+	_("Divide network into near straight-line segments and calculate its order");
     G_add_keyword(_("raster"));
     G_add_keyword(_("hydrology"));
     G_add_keyword("Stream divide");
@@ -75,12 +75,12 @@
     out_segment_opt = G_define_standard_option(G_OPT_V_OUTPUT);
     out_segment_opt->key = "segments";
     out_segment_opt->description =
-	_("OUTPUT vector file to write segment atributes");
+	_("OUTPUT vector file to write segment attributes");
 
     out_sector_opt = G_define_standard_option(G_OPT_V_OUTPUT);
     out_sector_opt->key = "sectors";
     out_sector_opt->description =
-	_("OUTPUT vector file to write segment atributes");
+	_("OUTPUT vector file to write segment attributes");
 
     opt_length = G_define_option();
     opt_length->key = "length";
@@ -99,8 +99,8 @@
     opt_skip->guisection = _("Optional");
 
     opt_threshold = G_define_option();
-    opt_threshold->key = "treshold";
-    opt_threshold->label = _("Max angle (degrees) beetwen stream segments");
+    opt_threshold->key = "threshold";
+    opt_threshold->label = _("Max angle (degrees) between stream segments");
     opt_threshold->description = _("Must be > 0");
     opt_threshold->answer = "160";
     opt_threshold->type = TYPE_DOUBLE;
@@ -135,7 +135,7 @@
     if (seg_length <= 0)
 	G_fatal_error("Search's length must be > 0");
     if (seg_treshold < 0 || seg_treshold > 180)
-	G_fatal_error("Treshold must be between 0 and 180");
+	G_fatal_error("Threshold must be between 0 and 180");
     if (seg_skip < 0)
 	G_fatal_error("Segment's length must be >= 0");
 

Modified: grass-addons/grass7/raster/r.stream.segment/r.stream.segment.html
===================================================================
--- grass-addons/grass7/raster/r.stream.segment/r.stream.segment.html	2014-03-26 15:21:32 UTC (rev 59369)
+++ grass-addons/grass7/raster/r.stream.segment/r.stream.segment.html	2014-03-26 15:33:49 UTC (rev 59370)
@@ -11,7 +11,7 @@
 <dd>Stream network: name of input stream map. Streams shall be ordered according
 one of the r.stream.order ordering system as well as unordered (with original
 stream identifiers)  Because streams network produced by r.watershed and
-r.stream.extract may slighty differ in detail it is required to use both stream
+r.stream.extract may slightly differ in detail it is required to use both stream
 and direction map produced by the same module. Stream background shall have NULL
 value or zero value. Background values of NULL are by default produced by
 r.watershed and r.stream.extract. If not 0 or NULL use <a
@@ -23,7 +23,7 @@
 values in places where streams occur. NULL (nodata) cells are ignored, zero and
 negative values are valid direction data if they vary from -8 to 8 (CCW from
 East in steps of 45 degrees). Direction map shall be of type CELL values. Region
-resolution and map resoultion must be the same. 
+resolution and map resolution must be the same. 
 Also <em>stream</em> network map must have the same resolution. It is checked by
 default. If resolutions differ the module informs about it and stops. Region
 boundary and maps boundary may be differ but it may lead to unexpected
@@ -33,30 +33,30 @@
 DCELL. It is not restricted to resolution of region settings as streams and
 dirs.</dd>
 <dt><b>length</b></dt>
-<dd>Integer values indicating the search length (in cells) to determine stright
+<dd>Integer values indicating the search length (in cells) to determine straight
 line. The longest length parameter the module treats more tolerant local stream
 undulation and inequalities. Default value of 15 is suitable for  30 meters
 DEMS. More detail DEMS may requre longer length.</dd>
 
 <dt><b>skip</b></dt>
 <dd>Integer values indicating the length (in cells) local short segment to skip
-and join them to the longer neigbour. The shortest length parameter the more
+and join them to the longer neighbour. The shortest length parameter the more
 short segments will be produced by the module due to undulation and
 inequalities. Default value of 5 is suitable for  30 meters DEMS. More details
-DEMS may requre longer length.</dd>
+DEMS may require longer length.</dd>
 
 <dt><b>treshold</b></dt>
-<dd>real value indicates the internal angle between upstream and downsteam
-direction to treat actual cell as lying on the stright line. greater value (up to
+<dd>real value indicates the internal angle between upstream and downstream
+direction to treat actual cell as lying on the straight line. greater value (up to
 180 degrees) produces more segments. Lesser values produced less segments.
-Values below 90 in most cases will not produce any addational segments to these
+Values below 90 in most cases will not produce any additional segments to these
 resulting from ordering
 </dl>
 <dl>
 <h2>OUTPUTS</h2>
 <p>The module produces two vector maps: one representing original segments
 (where segment is a streamline where its order remains unchanged) and second
-divided into near stright line sectors resulting form segmentation proccess.
+divided into near straight line sectors resulting form segmentation process.
 Most of segment and sectors attributes are the same as in r.stream.order vector
 output.</p>
 <dl>
@@ -71,14 +71,14 @@
 <li><b>direction</b>: double precision, full segment direction (0-360)
 <li><b>azimuth</b>: double precision, full segment azimuth (0-180) 
 <li><b>length</b>: double precision, segment length
-<li><b>stright</b>: double precision, length of stright line between segment
+<li><b>straight</b>: double precision, length of straight line between segment
 nodes
-<li><b>sinusoid</b>: double precision, sinusoid (length/stright)
+<li><b>sinusoid</b>: double precision, sinusoid (length/straight)
 <li><b>elev_min</b>: double precision, minimum elevation (elevation at segment
 start)
 <li><b>elev_max</b>: double precision, maximum elevation (elevation at segment
 end)
-<li><b>s_drop</b>: double precision, deifference between start and end of the
+<li><b>s_drop</b>: double precision, difference between start and end of the
 segment
 <li><b>gradient</b>: double precision, drop/length
 <li><b>out_direction</b>: double precision, direction (0-360) of segment end
@@ -102,19 +102,19 @@
 <dd>Vector map where every sector has its own category and following attributes:
 <ul>
 <li><b>sector</b>: integer, sector category
-<li><b>segment</b>: integer, segment category (to estabilsh relationship)
+<li><b>segment</b>: integer, segment category (to establish relationship)
 <li><b>s_order</b>: integer, segment order
 <li><b>direction</b>: double precision, sector direction
 <li><b>azimuth</b>: double precision, sector azimuth
 <li><b>length</b>: double precision, sector length
-<li><b>stright</b>: double precision, length of stright line between sector
+<li><b>straight</b>: double precision, length of straight line between sector
 nodes
-<li><b>sinusoid</b>: double precision, sinusoid (length/stright)
+<li><b>sinusoid</b>: double precision, sinusoid (length/straight)
 <li><b>elev_min</b>: double precision, minimum elevation (elevation at sector
 start)
 <li><b>elev_max</b>: double precision, minimum elevation (elevation at sector
 end)
-<li><b>s_drop</b>: double precision, deifference between start and end of the
+<li><b>s_drop</b>: double precision, difference between start and end of the
 sector
 <li><b>gradient</b>: double precision, drop/length
 </ul>
@@ -124,7 +124,7 @@
 </dl>
 <p>
 The main idea comes from works of Horton (1932) and Howard (1971, 1990). The
-module is designed to inverstigate network lineaments and calculate angle
+module is designed to investigate network lineaments and calculate angle
 relations between tributaries and its major streams. The main problem in
 calculating directional parameters is that streams usually are not straight
 lines. Therefore as the first step of the procedure, partitioning of streams

Modified: grass-addons/grass7/raster/r.stream.segment/stream_segment.c
===================================================================
--- grass-addons/grass7/raster/r.stream.segment/stream_segment.c	2014-03-26 15:21:32 UTC (rev 59369)
+++ grass-addons/grass7/raster/r.stream.segment/stream_segment.c	2014-03-26 15:33:49 UTC (rev 59370)
@@ -171,7 +171,7 @@
     cur_stream->sector_drops =
 	(float *)G_malloc(number_of_sectors * sizeof(float));
 
-    /* add attributies */
+    /* add attributes */
     for (i = 0, prev_i = 0; i < number_of_cells + 1; ++i) {
 	if (streamline[i].decision == 1 || i == (number_of_cells - 1)) {
 

Modified: grass-addons/grass7/raster/r.stream.segment/stream_topology.c
===================================================================
--- grass-addons/grass7/raster/r.stream.segment/stream_topology.c	2014-03-26 15:21:32 UTC (rev 59369)
+++ grass-addons/grass7/raster/r.stream.segment/stream_topology.c	2014-03-26 15:33:49 UTC (rev 59370)
@@ -14,7 +14,7 @@
 }
 
 int ram_trib_nums(int r, int c, CELL ** streams, CELL ** dirs)
-{				/* calculate number of tributuaries */
+{				/* calculate number of tributaries */
 
     int trib_num = 0;
     int i, j;
@@ -56,7 +56,7 @@
 
 
 int seg_trib_nums(int r, int c, SEGMENT *streams, SEGMENT *dirs)
-{				/* calculate number of tributuaries */
+{				/* calculate number of tributaries */
 
     int trib_num = 0;
     int i, j;
@@ -296,7 +296,7 @@
 		}
 	}
 
-    /* buildning streamline */
+    /* building streamline */
     for (i = 1; i < stream_num; ++i) {
 
 	r = (int)SA[i].init / ncols;
@@ -545,7 +545,7 @@
 int convert_border_dir(int r, int c, int dir)
 {
     /* this function must be added to other modules */
-    /* this is added to fix r.stream.extract issue with broder cell direction */
+    /* this is added to fix r.stream.extract issue with broader cell direction */
     if (dir)
 	return dir;
 



More information about the grass-commit mailing list