[GRASS-SVN] r61830 - in grass-addons/grass7/raster: r.convergence r.crater r.univar2

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Sep 7 07:09:58 PDT 2014


Author: neteler
Date: 2014-09-07 07:09:57 -0700 (Sun, 07 Sep 2014)
New Revision: 61830

Added:
   grass-addons/grass7/raster/r.univar2/r.univar2.html
Removed:
   grass-addons/grass7/raster/r.univar2/r.univar.html
Modified:
   grass-addons/grass7/raster/r.convergence/r.convergence.html
   grass-addons/grass7/raster/r.crater/main.c
   grass-addons/grass7/raster/r.crater/r.crater.html
   grass-addons/grass7/raster/r.univar2/globals.h
   grass-addons/grass7/raster/r.univar2/r.univar_main.c
Log:
GRASS 7 Addons: some compiler fixes for http://grass.osgeo.org/addons/grass7/logs/

Modified: grass-addons/grass7/raster/r.convergence/r.convergence.html
===================================================================
--- grass-addons/grass7/raster/r.convergence/r.convergence.html	2014-09-07 14:09:28 UTC (rev 61829)
+++ grass-addons/grass7/raster/r.convergence/r.convergence.html	2014-09-07 14:09:57 UTC (rev 61830)
@@ -28,13 +28,25 @@
 
 
 <h2>DESCRIPTION</h2>
+
+<h3>How convergence index is calculated (3 x 3 window):</h3>
 <center>
-<h3>How convergence index is calculated (3 x 3 window):<h3>
 <img src="conv.png" border="1"><br>
 </center>
-Convergence index is a terrain parameter which show the structure od the relief as a set of convergent areas (channels) and divergent areas (ridges). It represents the agreement of aspect direction of surrounding cells with the teoretical matrix direction. Convergence index is mean (or weighted mean if weights are used) aspect difference between real aspect and teoretical maximum divergent direction matrix representing ideal peak (see figure) minus 90 degres. So if there is maximum agreement with divergent matrix the convergence index is (0 - 90) * 10/9 = -100. If there is ideal sink (maximum convergence) the convergence index is (180 -90) * 10/9 = 100.
-Slope and aspect ere calculated internaly with the same formula as in r.slope.aspect
-Convergence index is very useful for analysis of lineamets especially represented by rigdes or chanell systems as well as valley recognition tool.
+Convergence index is a terrain parameter which show the structure od 
+the relief as a set of convergent areas (channels) and divergent areas 
+(ridges). It represents the agreement of aspect direction of 
+surrounding cells with the teoretical matrix direction. Convergence 
+index is mean (or weighted mean if weights are used) aspect difference 
+between real aspect and teoretical maximum divergent direction matrix 
+representing ideal peak (see figure) minus 90 degres. So if there is 
+maximum agreement with divergent matrix the convergence index is (0 - 
+90) * 10/9 = -100. If there is ideal sink (maximum convergence) the 
+convergence index is (180 -90) * 10/9 = 100. Slope and aspect ere 
+calculated internaly with the same formula as in r.slope.aspect 
+Convergence index is very useful for analysis of lineamets especially 
+represented by rigdes or chanell systems as well as valley recognition 
+tool.
 
 
 <h2>SEE ALSO</h2>

Modified: grass-addons/grass7/raster/r.crater/main.c
===================================================================
--- grass-addons/grass7/raster/r.crater/main.c	2014-09-07 14:09:28 UTC (rev 61829)
+++ grass-addons/grass7/raster/r.crater/main.c	2014-09-07 14:09:57 UTC (rev 61830)
@@ -20,6 +20,7 @@
 #include <grass/gis.h>
 #include <grass/raster.h>
 #include <grass/glocale.h>
+#include "crater.h"
 
 int main(int argc, char *argv[]) 
 {
@@ -271,7 +272,7 @@
 			else if (scaling_law==2)/*flag3 is Yield scaling law*/
 				d_Dt = Yield_Dat(d_W,d_r_proj,d_r_targ,d_L);
 			else /*default is Pi-scaling*/
-				d_Dt = Pi_Dat(d_W,d_r_proj,d_r_targ,d_L);
+				d_Dt = Pi_Dat(d_W,d_r_proj,d_r_targ,d_L,d_g);
 		} else {
 			/*Backward mode*/
 			if(scaling_law==1) /*flag 2 is Gault scaling law*/

Modified: grass-addons/grass7/raster/r.crater/r.crater.html
===================================================================
--- grass-addons/grass7/raster/r.crater/r.crater.html	2014-09-07 14:09:28 UTC (rev 61829)
+++ grass-addons/grass7/raster/r.crater/r.crater.html	2014-09-07 14:09:57 UTC (rev 61830)
@@ -58,7 +58,7 @@
 </em>
 
 <h2>AUTHOR</h2>
-GRASS Development Team<br>
+Yann Chemin
 
 <p>
 <i>Last changed: $Date$</i>

Modified: grass-addons/grass7/raster/r.univar2/globals.h
===================================================================
--- grass-addons/grass7/raster/r.univar2/globals.h	2014-09-07 14:09:28 UTC (rev 61829)
+++ grass-addons/grass7/raster/r.univar2/globals.h	2014-09-07 14:09:57 UTC (rev 61830)
@@ -19,7 +19,6 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <math.h>
-#include "../r.flow/mem.h"
 #include <grass/gis.h>
 #include <grass/raster.h>
 #include <grass/glocale.h>

Deleted: grass-addons/grass7/raster/r.univar2/r.univar.html
===================================================================
--- grass-addons/grass7/raster/r.univar2/r.univar.html	2014-09-07 14:09:28 UTC (rev 61829)
+++ grass-addons/grass7/raster/r.univar2/r.univar.html	2014-09-07 14:09:57 UTC (rev 61830)
@@ -1,136 +0,0 @@
-<h2>DESCRIPTION</h2>
-
-<em>r.univar</em> calculates the univariate statistics of one or several raster
-map(s). This includes the number of cells counted, minimum and maximum cell
-values, range, arithmetic mean, population variance, standard deviation, and 
-coefficient of variation. Statistics are calculated separately for every
-category/zone found in the <b>zones</b> input map if given.
-If the <b>-e</b> extended statistics flag is given the 1st quartile, median,
-3rd quartile, and given <b>percentile</b> are calculated.
-If the <b>-g</b> flag is given the results are presented in a format suitable
-for use in a shell script.
-If the <b>-t</b> flag is given the results are presented in tabular format
-with the given field separator. The table can immediately be converted to a
-vector attribute table which can then be linked to a vector, e.g. the vector
-that was rasterized to create the <b>zones</b> input raster.
-<p>
-When multiple input maps are given to <em>r.univar</em>, the overall statistics
-are calculated. This is useful for a time series of the same variable, as well as
-for the case of a segmented/tiled dataset. Allowing multiple raster maps to be
-specified saves the user from using a temporary raster map for the result of 
-<em>r.series</em> or <em>r.patch</em>.
-
-<h2>NOTES</h2>
-
-As with most GRASS raster modules, <em>r.univar</em> operates on the raster
-array defined by the current region settings, not the original extent and
-resolution of the input map. See <em><a href="g.region.html">g.region</a></em>.
-<p>
-This module can use large amounts of system memory when the <b>-e</b>
-extended statistics flag is used with a very large region setting. If the
-region is too large the module should exit gracefully with a memory allocation
-error. Basic statistics can be calculated using any size input region.
-<p>
-Without a <b>zones</b> input raster, the <em>r.quantile</em> module will
-be significantly more efficient for calculating percentiles with large maps.
-
-<h2>EXAMPLE</h2>
-
-Calculate the raster statistics for zones within a vector map coverage
-and upload the results for mean, min and max back to the vector map:
-
-<div class="code"><pre>
-#### set the raster region to match the map
-g.region vect=fields res=10 -ap
-
-#### create rasterized version of vector map
-v.to.rast in=fields out=fields.10m use=cat type=area labelcolumn=label
-r.colors fields.10m color=random
-
-#### perform analysis
-r.univar -t map=elevation.10m zones=fields.10m | \
-  cut -f1,5,6,8 -d'|' > fields_stats.txt
-
-
-#### populate vector DB with stats
-
-# create working copy of vector map
-g.copy vect=fields,fields_stats
-
-# create new attribute columns to hold output
-v.db.addcol map=fields_stats \
-  columns='mean_elev DOUBLE PRECISION, min_elev DOUBLE PRECISION, max_elev DOUBLE PRECISION'
-
-# create SQL command file, and execute it
-sed -e '1d' fields_stats.txt | awk -F'|' \
-  '{print "UPDATE fields_stats SET min_elev = "$2", max_elev = "$3", \
-  mean_elev = "$4" WHERE cat = "$1";"}' \
-   > fields_stats_sqlcmd.txt
-
-db.execute input=fields_stats_sqlcmd.txt
-<!--
-
-###### alternate method with db.in.ogr:  (needs work) ######
-
-#### convert text file table to a database table
-# not safe for commas in the label
-tr '|' ',' < fields_stats.txt > fields_stats.csv
-echo '"Integer","String","Real","Real","Real"' > fields_stats.csvt
-
-# import table
-db.in.ogr dsn=fields_stats.csv output=fields_data
-
-# view table
-db.select fields_data
-
-# remove temporary files
-rm fields_stats.csv fields_stats.csvt fields_stats.txt
-
-
-#### populate vector DB with stats
-
-# create working copy of vector map
-g.copy vect=fields,fields_stats
-
-# create new attribute columns to hold output
-v.db.addcol map=fields_stats \
-  columns='mean_elev DOUBLE PRECISION, min_elev DOUBLE PRECISION, max_elev DOUBLE PRECISION'
-
-# perform DB step  (broken)
-## how to automatically collate by key column, ie copy between tables?
-## SELECT INTO? JOIN?
-echo "INSERT INTO fields_stats (mean_elev,min_elev,max_elev) SELECT mean,min,max FROM fields_data" | db.execute
--->
-
-#### view completed table
-v.db.select fields_stats
-</pre></div>
-
-
-<h2>TODO</h2>
-
-<i>mode, skewness, kurtosis</i>
-
-<h2>SEE ALSO</h2>
-
-<em>
-<a href="g.region.html">g.region</a>,
-<a href="r3.univar.html">r3.univar</a>,
-<a href="r.mode.html">r.mode</a>,
-<a href="r.quantile.html">r.quantile</a>,
-<a href="r.series.html">r.series</a>,
-<a href="r.stats.html">r.stats</a>,
-<a href="r.statistics.html">r.statistics</a>,
-<a href="v.rast.stats.html">v.rast.stats</a>,
-<a href="v.univar.html">v.univar</a>
-</em>
-
-
-<h2>AUTHORS</h2>
-
-Hamish Bowman, Otago University, New Zealand<br>
-Extended statistics by Martin Landa<br>
-Multiple input map support by Ivan Shmakov<br>
-Zonal loop by Markus Metz
-
-<p><i>Last changed: $Date$</i>

Copied: grass-addons/grass7/raster/r.univar2/r.univar2.html (from rev 61825, grass-addons/grass7/raster/r.univar2/r.univar.html)
===================================================================
--- grass-addons/grass7/raster/r.univar2/r.univar2.html	                        (rev 0)
+++ grass-addons/grass7/raster/r.univar2/r.univar2.html	2014-09-07 14:09:57 UTC (rev 61830)
@@ -0,0 +1,136 @@
+<h2>DESCRIPTION</h2>
+
+<em>r.univar</em> calculates the univariate statistics of one or several raster
+map(s). This includes the number of cells counted, minimum and maximum cell
+values, range, arithmetic mean, population variance, standard deviation, and 
+coefficient of variation. Statistics are calculated separately for every
+category/zone found in the <b>zones</b> input map if given.
+If the <b>-e</b> extended statistics flag is given the 1st quartile, median,
+3rd quartile, and given <b>percentile</b> are calculated.
+If the <b>-g</b> flag is given the results are presented in a format suitable
+for use in a shell script.
+If the <b>-t</b> flag is given the results are presented in tabular format
+with the given field separator. The table can immediately be converted to a
+vector attribute table which can then be linked to a vector, e.g. the vector
+that was rasterized to create the <b>zones</b> input raster.
+<p>
+When multiple input maps are given to <em>r.univar</em>, the overall statistics
+are calculated. This is useful for a time series of the same variable, as well as
+for the case of a segmented/tiled dataset. Allowing multiple raster maps to be
+specified saves the user from using a temporary raster map for the result of 
+<em>r.series</em> or <em>r.patch</em>.
+
+<h2>NOTES</h2>
+
+As with most GRASS raster modules, <em>r.univar</em> operates on the raster
+array defined by the current region settings, not the original extent and
+resolution of the input map. See <em><a href="g.region.html">g.region</a></em>.
+<p>
+This module can use large amounts of system memory when the <b>-e</b>
+extended statistics flag is used with a very large region setting. If the
+region is too large the module should exit gracefully with a memory allocation
+error. Basic statistics can be calculated using any size input region.
+<p>
+Without a <b>zones</b> input raster, the <em>r.quantile</em> module will
+be significantly more efficient for calculating percentiles with large maps.
+
+<h2>EXAMPLE</h2>
+
+Calculate the raster statistics for zones within a vector map coverage
+and upload the results for mean, min and max back to the vector map:
+
+<div class="code"><pre>
+#### set the raster region to match the map
+g.region vect=fields res=10 -ap
+
+#### create rasterized version of vector map
+v.to.rast in=fields out=fields.10m use=cat type=area labelcolumn=label
+r.colors fields.10m color=random
+
+#### perform analysis
+r.univar -t map=elevation.10m zones=fields.10m | \
+  cut -f1,5,6,8 -d'|' > fields_stats.txt
+
+
+#### populate vector DB with stats
+
+# create working copy of vector map
+g.copy vect=fields,fields_stats
+
+# create new attribute columns to hold output
+v.db.addcol map=fields_stats \
+  columns='mean_elev DOUBLE PRECISION, min_elev DOUBLE PRECISION, max_elev DOUBLE PRECISION'
+
+# create SQL command file, and execute it
+sed -e '1d' fields_stats.txt | awk -F'|' \
+  '{print "UPDATE fields_stats SET min_elev = "$2", max_elev = "$3", \
+  mean_elev = "$4" WHERE cat = "$1";"}' \
+   > fields_stats_sqlcmd.txt
+
+db.execute input=fields_stats_sqlcmd.txt
+<!--
+
+###### alternate method with db.in.ogr:  (needs work) ######
+
+#### convert text file table to a database table
+# not safe for commas in the label
+tr '|' ',' < fields_stats.txt > fields_stats.csv
+echo '"Integer","String","Real","Real","Real"' > fields_stats.csvt
+
+# import table
+db.in.ogr dsn=fields_stats.csv output=fields_data
+
+# view table
+db.select fields_data
+
+# remove temporary files
+rm fields_stats.csv fields_stats.csvt fields_stats.txt
+
+
+#### populate vector DB with stats
+
+# create working copy of vector map
+g.copy vect=fields,fields_stats
+
+# create new attribute columns to hold output
+v.db.addcol map=fields_stats \
+  columns='mean_elev DOUBLE PRECISION, min_elev DOUBLE PRECISION, max_elev DOUBLE PRECISION'
+
+# perform DB step  (broken)
+## how to automatically collate by key column, ie copy between tables?
+## SELECT INTO? JOIN?
+echo "INSERT INTO fields_stats (mean_elev,min_elev,max_elev) SELECT mean,min,max FROM fields_data" | db.execute
+-->
+
+#### view completed table
+v.db.select fields_stats
+</pre></div>
+
+
+<h2>TODO</h2>
+
+<i>mode, skewness, kurtosis</i>
+
+<h2>SEE ALSO</h2>
+
+<em>
+<a href="g.region.html">g.region</a>,
+<a href="r3.univar.html">r3.univar</a>,
+<a href="r.mode.html">r.mode</a>,
+<a href="r.quantile.html">r.quantile</a>,
+<a href="r.series.html">r.series</a>,
+<a href="r.stats.html">r.stats</a>,
+<a href="r.statistics.html">r.statistics</a>,
+<a href="v.rast.stats.html">v.rast.stats</a>,
+<a href="v.univar.html">v.univar</a>
+</em>
+
+
+<h2>AUTHORS</h2>
+
+Hamish Bowman, Otago University, New Zealand<br>
+Extended statistics by Martin Landa<br>
+Multiple input map support by Ivan Shmakov<br>
+Zonal loop by Markus Metz
+
+<p><i>Last changed: $Date$</i>

Modified: grass-addons/grass7/raster/r.univar2/r.univar_main.c
===================================================================
--- grass-addons/grass7/raster/r.univar2/r.univar_main.c	2014-09-07 14:09:28 UTC (rev 61829)
+++ grass-addons/grass7/raster/r.univar2/r.univar_main.c	2014-09-07 14:09:57 UTC (rev 61830)
@@ -18,7 +18,6 @@
 #include <assert.h>
 #include <string.h>
 #include "globals.h"
-#include "../../vector/v.vol.rst/userglobs.h"
 
 param_type param;
 zone_type zone_info;



More information about the grass-commit mailing list