Explorar o código

r.slope.aspect: min_slp_allowed -> min_slope (https://trac.osgeo.org/grass/changeset/63053)

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@63124 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Neteler %!s(int64=10) %!d(string=hai) anos
pai
achega
2df32516eb

+ 1 - 1
raster/r.info/r.info.html

@@ -68,7 +68,7 @@ r.info slope
  |   Comments:                                                                |
  |   Comments:                                                                |
  |    slope map elev = elev_ned10m                                            |
  |    slope map elev = elev_ned10m                                            |
  |    zfactor = 1.00 format = degrees                                         |
  |    zfactor = 1.00 format = degrees                                         |
- |    min_slp_allowed = 0.000000                                              |
+ |    min_slope = 0.000000                                              |
  |                                                                            |
  |                                                                            |
  +----------------------------------------------------------------------------+
  +----------------------------------------------------------------------------+
 </pre></div>
 </pre></div>

+ 25 - 25
raster/r.slope.aspect/main.c

@@ -44,7 +44,7 @@
  * or tangential curvature filename required
  * or tangential curvature filename required
  * usage: r.slope.aspect [-av] elevation=input slope=output1 aspect=output2
  * usage: r.slope.aspect [-av] elevation=input slope=output1 aspect=output2
  *	pcurv=output3 tcurv=output4 format=name prec=name zfactor=value
  *	pcurv=output3 tcurv=output4 format=name prec=name zfactor=value
- *	min_slp_allowed=value dx=output5 dy=output6 dxx=output7 
+ *	min_slope=value dx=output5 dy=output6 dxx=output7 
  *      dyy=output8 dxy=output9
  *      dyy=output8 dxy=output9
  * -a don't align window
  * -a don't align window
  * -q quiet
  * -q quiet
@@ -128,7 +128,7 @@ int main(int argc, char *argv[])
     double tan_ans;
     double tan_ans;
     double key;
     double key;
     double slp_in_perc, slp_in_deg;
     double slp_in_perc, slp_in_deg;
-    double min_slp = 900., max_slp = 0., min_slp_allowed;
+    double min_slp = 900., max_slp = 0., min_slope;
     int low, hi, test = 0;
     int low, hi, test = 0;
     int deg = 0;
     int deg = 0;
     int perc = 0;
     int perc = 0;
@@ -137,7 +137,7 @@ int main(int argc, char *argv[])
     struct
     struct
     {
     {
 	struct Option *elevation, *slope_fmt, *slope, *aspect, *pcurv, *tcurv,
 	struct Option *elevation, *slope_fmt, *slope, *aspect, *pcurv, *tcurv,
-	    *zfactor, *min_slp_allowed, *out_precision,
+	    *zfactor, *min_slope, *out_precision,
 	    *dx, *dy, *dxx, *dyy, *dxy;
 	    *dx, *dy, *dxx, *dyy, *dxy;
     } parm;
     } parm;
     struct
     struct
@@ -244,14 +244,14 @@ int main(int argc, char *argv[])
     parm.zfactor->answer = "1.0";
     parm.zfactor->answer = "1.0";
     parm.zfactor->guisection = _("Settings");
     parm.zfactor->guisection = _("Settings");
 
 
-    parm.min_slp_allowed = G_define_option();
-    parm.min_slp_allowed->key = "min_slope";
-    parm.min_slp_allowed->description =
+    parm.min_slope = G_define_option();
+    parm.min_slope->key = "min_slope";
+    parm.min_slope->description =
 	_("Minimum slope value (in percent) for which aspect is computed");
 	_("Minimum slope value (in percent) for which aspect is computed");
-    parm.min_slp_allowed->type = TYPE_DOUBLE;
-    parm.min_slp_allowed->required = NO;
-    parm.min_slp_allowed->answer = "0.0";
-    parm.min_slp_allowed->guisection = _("Settings");
+    parm.min_slope->type = TYPE_DOUBLE;
+    parm.min_slope->required = NO;
+    parm.min_slope->answer = "0.0";
+    parm.min_slope->guisection = _("Settings");
 
 
     flag.a = G_define_flag();
     flag.a = G_define_flag();
     flag.a->key = 'a';
     flag.a->key = 'a';
@@ -314,11 +314,11 @@ int main(int argc, char *argv[])
 		      parm.zfactor->key, parm.zfactor->answer);
 		      parm.zfactor->key, parm.zfactor->answer);
     }
     }
 
 
-    if (sscanf(parm.min_slp_allowed->answer, "%lf", &min_slp_allowed) != 1 ||
-	min_slp_allowed < 0.0) {
+    if (sscanf(parm.min_slope->answer, "%lf", &min_slope) != 1 ||
+	min_slope < 0.0) {
 	G_fatal_error(_("%s=%s - must be a non-negative number"),
 	G_fatal_error(_("%s=%s - must be a non-negative number"),
-		      parm.min_slp_allowed->key,
-		      parm.min_slp_allowed->answer);
+		      parm.min_slope->key,
+		      parm.min_slope->answer);
     }
     }
 
 
     slope_fmt = parm.slope_fmt->answer;
     slope_fmt = parm.slope_fmt->answer;
@@ -746,7 +746,7 @@ int main(int argc, char *argv[])
 		if (max_slp < slp_in_perc)
 		if (max_slp < slp_in_perc)
 		    max_slp = slp_in_perc;
 		    max_slp = slp_in_perc;
 	    }
 	    }
-	    if (slp_in_perc < min_slp_allowed)
+	    if (slp_in_perc < min_slope)
 		slp_in_perc = 0.;
 		slp_in_perc = 0.;
 
 
 	    if (deg && out_type == CELL_TYPE) {
 	    if (deg && out_type == CELL_TYPE) {
@@ -808,7 +808,7 @@ int main(int argc, char *argv[])
 
 
 		/* if it's not the case that the slope for this cell 
 		/* if it's not the case that the slope for this cell 
 		   is below specified minimum */
 		   is below specified minimum */
-		if (!((slope_fd > 0) && (slp_in_perc < min_slp_allowed))) {
+		if (!((slope_fd > 0) && (slp_in_perc < min_slope))) {
 		    if (out_type == CELL_TYPE)
 		    if (out_type == CELL_TYPE)
 			*((CELL *) asp_ptr) = (CELL) (aspect + .5);
 			*((CELL *) asp_ptr) = (CELL) (aspect + .5);
 		    else
 		    else
@@ -1040,7 +1040,7 @@ int main(int argc, char *argv[])
 	Rast_short_history(aspect_name, "raster", &hist);
 	Rast_short_history(aspect_name, "raster", &hist);
 	Rast_append_format_history(&hist, "aspect map elev = %s", elev_name);
 	Rast_append_format_history(&hist, "aspect map elev = %s", elev_name);
 	Rast_append_format_history(&hist, "zfactor = %.2f", zfactor);
 	Rast_append_format_history(&hist, "zfactor = %.2f", zfactor);
-	Rast_append_format_history(&hist, "min_slp_allowed = %f", min_slp_allowed);
+	Rast_append_format_history(&hist, "min_slope = %f", min_slope);
 	Rast_format_history(&hist, HIST_DATSRC_1, "raster elevation file %s", elev_name);
 	Rast_format_history(&hist, HIST_DATSRC_1, "raster elevation file %s", elev_name);
 	Rast_command_history(&hist);
 	Rast_command_history(&hist);
 	Rast_write_history(aspect_name, &hist);
 	Rast_write_history(aspect_name, &hist);
@@ -1150,7 +1150,7 @@ int main(int argc, char *argv[])
 	Rast_append_format_history(&hist, "slope map elev = %s", elev_name);
 	Rast_append_format_history(&hist, "slope map elev = %s", elev_name);
 	Rast_append_format_history(&hist, "zfactor = %.2f format = %s", zfactor,
 	Rast_append_format_history(&hist, "zfactor = %.2f format = %s", zfactor,
 		parm.slope_fmt->answer);
 		parm.slope_fmt->answer);
-	Rast_append_format_history(&hist, "min_slp_allowed = %f", min_slp_allowed);
+	Rast_append_format_history(&hist, "min_slope = %f", min_slope);
 	Rast_format_history(&hist, HIST_DATSRC_1, "raster elevation file %s", elev_name);
 	Rast_format_history(&hist, HIST_DATSRC_1, "raster elevation file %s", elev_name);
 	Rast_command_history(&hist);
 	Rast_command_history(&hist);
 	Rast_write_history(slope_name, &hist);
 	Rast_write_history(slope_name, &hist);
@@ -1222,7 +1222,7 @@ int main(int argc, char *argv[])
 	Rast_short_history(pcurv_name, "raster", &hist);
 	Rast_short_history(pcurv_name, "raster", &hist);
 	Rast_append_format_history(&hist, "profile curve map elev = %s", elev_name);
 	Rast_append_format_history(&hist, "profile curve map elev = %s", elev_name);
 	Rast_append_format_history(&hist, "zfactor = %.2f", zfactor);
 	Rast_append_format_history(&hist, "zfactor = %.2f", zfactor);
-	Rast_append_format_history(&hist, "min_slp_allowed = %f", min_slp_allowed);
+	Rast_append_format_history(&hist, "min_slope = %f", min_slope);
 	Rast_format_history(&hist, HIST_DATSRC_1, "raster elevation file %s", elev_name);
 	Rast_format_history(&hist, HIST_DATSRC_1, "raster elevation file %s", elev_name);
 	Rast_command_history(&hist);
 	Rast_command_history(&hist);
 	Rast_write_history(pcurv_name, &hist);
 	Rast_write_history(pcurv_name, &hist);
@@ -1249,7 +1249,7 @@ int main(int argc, char *argv[])
 	Rast_short_history(tcurv_name, "raster", &hist);
 	Rast_short_history(tcurv_name, "raster", &hist);
 	Rast_append_format_history(&hist, "tangential curve map elev = %s", elev_name);
 	Rast_append_format_history(&hist, "tangential curve map elev = %s", elev_name);
 	Rast_append_format_history(&hist, "zfactor = %.2f", zfactor);
 	Rast_append_format_history(&hist, "zfactor = %.2f", zfactor);
-	Rast_append_format_history(&hist, "min_slp_allowed = %f", min_slp_allowed);
+	Rast_append_format_history(&hist, "min_slope = %f", min_slope);
 	Rast_format_history(&hist, HIST_DATSRC_1, "raster elevation file %s", elev_name);
 	Rast_format_history(&hist, HIST_DATSRC_1, "raster elevation file %s", elev_name);
 	Rast_command_history(&hist);
 	Rast_command_history(&hist);
 	Rast_write_history(tcurv_name, &hist);
 	Rast_write_history(tcurv_name, &hist);
@@ -1274,7 +1274,7 @@ int main(int argc, char *argv[])
 	Rast_short_history(dx_name, "raster", &hist);
 	Rast_short_history(dx_name, "raster", &hist);
 	Rast_append_format_history(&hist, "E-W slope map elev = %s", elev_name);
 	Rast_append_format_history(&hist, "E-W slope map elev = %s", elev_name);
 	Rast_append_format_history(&hist, "zfactor = %.2f", zfactor);
 	Rast_append_format_history(&hist, "zfactor = %.2f", zfactor);
-	Rast_append_format_history(&hist, "min_slp_allowed = %f", min_slp_allowed);
+	Rast_append_format_history(&hist, "min_slope = %f", min_slope);
 	Rast_format_history(&hist, HIST_DATSRC_1, "raster elevation file %s", elev_name);
 	Rast_format_history(&hist, HIST_DATSRC_1, "raster elevation file %s", elev_name);
 	Rast_command_history(&hist);
 	Rast_command_history(&hist);
 	Rast_write_history(dx_name, &hist);
 	Rast_write_history(dx_name, &hist);
@@ -1299,7 +1299,7 @@ int main(int argc, char *argv[])
 	Rast_short_history(dy_name, "raster", &hist);
 	Rast_short_history(dy_name, "raster", &hist);
 	Rast_append_format_history(&hist, "N-S slope map elev = %s", elev_name);
 	Rast_append_format_history(&hist, "N-S slope map elev = %s", elev_name);
 	Rast_append_format_history(&hist, "zfactor = %.2f", zfactor);
 	Rast_append_format_history(&hist, "zfactor = %.2f", zfactor);
-	Rast_append_format_history(&hist, "min_slp_allowed = %f", min_slp_allowed);
+	Rast_append_format_history(&hist, "min_slope = %f", min_slope);
 	Rast_format_history(&hist, HIST_DATSRC_1, "raster elevation file %s", elev_name);
 	Rast_format_history(&hist, HIST_DATSRC_1, "raster elevation file %s", elev_name);
 	Rast_command_history(&hist);
 	Rast_command_history(&hist);
 	Rast_write_history(dy_name, &hist);
 	Rast_write_history(dy_name, &hist);
@@ -1324,7 +1324,7 @@ int main(int argc, char *argv[])
 	Rast_short_history(dxx_name, "raster", &hist);
 	Rast_short_history(dxx_name, "raster", &hist);
 	Rast_append_format_history(&hist, "DXX map elev = %s", elev_name);
 	Rast_append_format_history(&hist, "DXX map elev = %s", elev_name);
 	Rast_append_format_history(&hist, "zfactor = %.2f", zfactor);
 	Rast_append_format_history(&hist, "zfactor = %.2f", zfactor);
-	Rast_append_format_history(&hist, "min_slp_allowed = %f", min_slp_allowed);
+	Rast_append_format_history(&hist, "min_slope = %f", min_slope);
 	Rast_format_history(&hist, HIST_DATSRC_1, "raster elevation file %s", elev_name);
 	Rast_format_history(&hist, HIST_DATSRC_1, "raster elevation file %s", elev_name);
 	Rast_command_history(&hist);
 	Rast_command_history(&hist);
 	Rast_write_history(dxx_name, &hist);
 	Rast_write_history(dxx_name, &hist);
@@ -1349,7 +1349,7 @@ int main(int argc, char *argv[])
 	Rast_short_history(dyy_name, "raster", &hist);
 	Rast_short_history(dyy_name, "raster", &hist);
 	Rast_append_format_history(&hist, "DYY map elev = %s", elev_name);
 	Rast_append_format_history(&hist, "DYY map elev = %s", elev_name);
 	Rast_append_format_history(&hist, "zfactor = %.2f", zfactor);
 	Rast_append_format_history(&hist, "zfactor = %.2f", zfactor);
-	Rast_append_format_history(&hist, "min_slp_allowed = %f", min_slp_allowed);
+	Rast_append_format_history(&hist, "min_slope = %f", min_slope);
 	Rast_format_history(&hist, HIST_DATSRC_1, "raster elevation file %s", elev_name);
 	Rast_format_history(&hist, HIST_DATSRC_1, "raster elevation file %s", elev_name);
 	Rast_command_history(&hist);
 	Rast_command_history(&hist);
 	Rast_write_history(dyy_name, &hist);
 	Rast_write_history(dyy_name, &hist);
@@ -1374,7 +1374,7 @@ int main(int argc, char *argv[])
 	Rast_short_history(dxy_name, "raster", &hist);
 	Rast_short_history(dxy_name, "raster", &hist);
 	Rast_append_format_history(&hist, "DXY map elev = %s", elev_name);
 	Rast_append_format_history(&hist, "DXY map elev = %s", elev_name);
 	Rast_append_format_history(&hist, "zfactor = %.2f", zfactor);
 	Rast_append_format_history(&hist, "zfactor = %.2f", zfactor);
-	Rast_append_format_history(&hist, "min_slp_allowed = %f", min_slp_allowed);
+	Rast_append_format_history(&hist, "min_slope = %f", min_slope);
 	Rast_format_history(&hist, HIST_DATSRC_1, "raster elevation file %s", elev_name);
 	Rast_format_history(&hist, HIST_DATSRC_1, "raster elevation file %s", elev_name);
 	Rast_command_history(&hist);
 	Rast_command_history(&hist);
 	Rast_write_history(dxy_name, &hist);
 	Rast_write_history(dxy_name, &hist);

+ 2 - 2
raster/r.slope.aspect/r.slope.aspect.html

@@ -28,9 +28,9 @@ Thus, most cells with a very small slope end up having category 0,
 45, ..., 360 in <b>aspect</b> output.
 45, ..., 360 in <b>aspect</b> output.
 It is possible to reduce the bias in these directions
 It is possible to reduce the bias in these directions
 by filtering out the aspect in areas where the terrain is almost flat.
 by filtering out the aspect in areas where the terrain is almost flat.
-A option <b>min_slp_allowed</b> can be used to specify the minimum slope
+A option <b>min_slope</b> can be used to specify the minimum slope
 for which aspect is computed. The aspect for all cells with
 for which aspect is computed. The aspect for all cells with
-slope&nbsp;&lt;&nbsp;<b>min_slp_allowed</b> is set to <i>null</i> (no-data).
+slope&nbsp;&lt;&nbsp;<b>min_slope</b> is set to <i>null</i> (no-data).
 
 
 <center>
 <center>
   <img src="aspect_diagram.png" border="0">
   <img src="aspect_diagram.png" border="0">