[GRASS-SVN] r53444 - grass/trunk/raster/r.univar
svn_grass at osgeo.org
svn_grass at osgeo.org
Wed Oct 17 11:49:54 PDT 2012
Author: martinl
Date: 2012-10-17 11:49:53 -0700 (Wed, 17 Oct 2012)
New Revision: 53444
Modified:
grass/trunk/raster/r.univar/r.univar_main.c
Log:
r.univar: more guisections
fix compiler warnings
Modified: grass/trunk/raster/r.univar/r.univar_main.c
===================================================================
--- grass/trunk/raster/r.univar/r.univar_main.c 2012-10-17 17:00:39 UTC (rev 53443)
+++ grass/trunk/raster/r.univar/r.univar_main.c 2012-10-17 18:49:53 UTC (rev 53444)
@@ -3,7 +3,7 @@
*
* Calculates univariate statistics from the non-null cells of a GRASS raster map
*
- * Copyright (C) 2004-2006 by the GRASS Development Team
+ * Copyright (C) 2004-2006, 2012 by the GRASS Development Team
* Author(s): Hamish Bowman, University of Otago, New Zealand
* Extended stats: Martin Landa
* Zonal stats: Markus Metz
@@ -39,6 +39,7 @@
param.output_file->required = NO;
param.output_file->description =
_("Name for output file (if omitted or \"-\" output to stdout)");
+ param.output_file->guisection = _("Output settings");
param.percentile = G_define_option();
param.percentile->key = "percentile";
@@ -49,21 +50,26 @@
param.percentile->answer = "90";
param.percentile->description =
_("Percentile to calculate (requires extended statistics flag)");
-
+ param.percentile->guisection = _("Extended");
+
param.separator = G_define_standard_option(G_OPT_F_SEP);
+ param.separator->guisection = _("Formatting");
param.shell_style = G_define_flag();
param.shell_style->key = 'g';
param.shell_style->description =
_("Print the stats in shell script style");
+ param.shell_style->guisection = _("Formatting");
param.extended = G_define_flag();
param.extended->key = 'e';
param.extended->description = _("Calculate extended statistics");
+ param.extended->guisection = _("Extended");
param.table = G_define_flag();
param.table->key = 't';
param.table->description = _("Table output format instead of standard output format");
+ param.table->guisection = _("Formatting");
return;
}
@@ -78,7 +84,6 @@
/* *************************************************************** */
int main(int argc, char *argv[])
{
- unsigned int rows, cols; /* totals */
int rasters;
struct Cell_head region;
@@ -111,9 +116,7 @@
}
G_get_window(®ion);
- rows = region.rows;
- cols = region.cols;
-
+
/* table field separator */
zone_info.sep = param.separator->answer;
if (strcmp(zone_info.sep, "\\t") == 0)
@@ -222,8 +225,8 @@
static univar_stat *univar_stat_with_percentiles(int map_type)
{
univar_stat *stats;
- int i, j;
- int n_zones = zone_info.n_zones;
+ unsigned int i, j;
+ unsigned int n_zones = zone_info.n_zones;
if (n_zones == 0)
n_zones = 1;
@@ -246,8 +249,8 @@
process_raster(univar_stat * stats, int fd, int fdz, const struct Cell_head *region)
{
/* use G_window_rows(), G_window_cols() here? */
- const int rows = region->rows;
- const int cols = region->cols;
+ const unsigned int rows = region->rows;
+ const unsigned int cols = region->cols;
const RASTER_MAP_TYPE map_type = Rast_get_map_type(fd);
const size_t value_sz = Rast_cell_size(map_type);
More information about the grass-commit
mailing list