[GRASS-SVN] r70297 - grass/trunk/raster/r.resamp.stats

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Jan 8 00:46:20 PST 2017


Author: marisn
Date: 2017-01-08 00:46:20 -0800 (Sun, 08 Jan 2017)
New Revision: 70297

Modified:
   grass/trunk/raster/r.resamp.stats/main.c
   grass/trunk/raster/r.resamp.stats/r.resamp.stats.html
Log:
Introduce also other stats methods to resampling module to better match r.neigbors offer


Modified: grass/trunk/raster/r.resamp.stats/main.c
===================================================================
--- grass/trunk/raster/r.resamp.stats/main.c	2017-01-08 03:22:33 UTC (rev 70296)
+++ grass/trunk/raster/r.resamp.stats/main.c	2017-01-08 08:46:20 UTC (rev 70297)
@@ -33,6 +33,7 @@
     {c_mode,   w_mode,   "mode",     "most frequently occurring value"},
     {c_min,    w_min,    "minimum",  "lowest value"},
     {c_max,    w_max,    "maximum",  "highest value"},
+    {c_range,  NULL,     "range",    "range value"},
     {c_quart1, w_quart1, "quart1",   "first quartile"},
     {c_quart3, w_quart3, "quart3",   "third quartile"},
     {c_perc90, w_perc90, "perc90",   "ninetieth percentile"},
@@ -40,6 +41,8 @@
     {c_var,    w_var,    "variance", "variance value"},
     {c_stddev, w_stddev, "stddev",   "standard deviation"},
     {c_quant,  w_quant,  "quantile", "arbitrary quantile"},
+    {c_count,  w_count,  "count",    "count of non-NULL values"},
+    {c_divr,   NULL,     "diversity", "number of different values"},
     {NULL, NULL, NULL, NULL}
 };
 
@@ -384,11 +387,14 @@
     Rast_write_history(parm.rastout->answer, &history);
 
     /* copy color table from source map */
-    if (strcmp(parm.method->answer, "sum") != 0) {
+    if (strcmp(parm.method->answer, "sum") != 0 &&
+        strcmp(parm.method->answer, "range") != 0 &&
+        strcmp(parm.method->answer, "count") != 0 &&
+        strcmp(parm.method->answer, "diversity") != 0) {
 	if (Rast_read_colors(parm.rastin->answer, "", &colors) < 0)
 	    G_fatal_error(_("Unable to read color table for %s"),
 			  parm.rastin->answer);
-	Rast_mark_colors_as_fp(&colors);
+        Rast_mark_colors_as_fp(&colors);
 	Rast_write_colors(parm.rastout->answer, G_mapset(), &colors);
     }
 

Modified: grass/trunk/raster/r.resamp.stats/r.resamp.stats.html
===================================================================
--- grass/trunk/raster/r.resamp.stats/r.resamp.stats.html	2017-01-08 03:22:33 UTC (rev 70296)
+++ grass/trunk/raster/r.resamp.stats/r.resamp.stats.html	2017-01-08 08:46:20 UTC (rev 70297)
@@ -49,11 +49,14 @@
 <a href="r.resample.html">r.resample</a>,
 <a href="r.resamp.rst.html">r.resamp.rst</a>,
 <a href="r.resamp.filter.html">r.resamp.filter</a>,
-<a href="r.resamp.interp.html">r.resamp.interp</a>
+<a href="r.resamp.interp.html">r.resamp.interp</a>,
+<a href="r.neighbors.html">r.neighbors</a>
 </em>
 
 <p>
 Overview: <a href="https://grasswiki.osgeo.org/wiki/Interpolation">Interpolation and Resampling</a> in GRASS GIS
+<p>
+Examples how statistical functions are applied can be found in the <a href="r.neighbors.html">r.neighbors</a> module documentation.
 
 <h2>AUTHOR</h2>
 



More information about the grass-commit mailing list