[GRASS-SVN] r71616 - grass-addons/grass7/imagery/i.segment.stats
svn_grass at osgeo.org
svn_grass at osgeo.org
Tue Oct 31 07:59:48 PDT 2017
Author: mlennert
Date: 2017-10-31 07:59:48 -0700 (Tue, 31 Oct 2017)
New Revision: 71616
Modified:
grass-addons/grass7/imagery/i.segment.stats/i.segment.stats.py
Log:
i.segment.stats: just some formatting
Modified: grass-addons/grass7/imagery/i.segment.stats/i.segment.stats.py
===================================================================
--- grass-addons/grass7/imagery/i.segment.stats/i.segment.stats.py 2017-10-30 21:44:50 UTC (rev 71615)
+++ grass-addons/grass7/imagery/i.segment.stats/i.segment.stats.py 2017-10-31 14:59:48 UTC (rev 71616)
@@ -63,16 +63,23 @@
#%option G_OPT_F_SEP
#% guisection: Output
#%end
-#% option G_OPT_V_OUTPUT
+#%option G_OPT_V_OUTPUT
#% key: vectormap
#% description: Name for optional vector output map with statistics as attributes
#% required: no
#% guisection: Output
#%end
+#%option
+#% key: processes
+#% type: integer
+#% description: Number of processes to run in parallel
+#% required: no
+#% answer: 1
+#%end
#%rules
#% required: csvfile,vectormap
#%end
-#% flag
+#%flag
#% key: r
#% description: Adjust region to input map
#%end
@@ -163,6 +170,8 @@
values = line.rstrip().split('|')
output_dict[values[0]] = [values[x] for x in stat_indices]
+ if rasters:
+ stat_indices = [raster_stat_dict[x] for x in raster_statistics]
for raster in rasters:
gscript.message(_("Calculating statistics for raster map <%s>..." % raster))
if not gscript.find_file(raster, element='cell')['name']:
@@ -171,7 +180,6 @@
rastername = raster.split('@')[0]
rastername = rastername.replace('.', '_')
output_header += [rastername + "_" + x for x in raster_statistics]
- stat_indices = [raster_stat_dict[x] for x in raster_statistics]
gscript.run_command('r.univar',
map_=raster,
zones=segment_map,
More information about the grass-commit
mailing list