[GRASS-SVN] r71029 - grass-addons/grass7/raster/r.vect.stats

svn_grass at osgeo.org svn_grass at osgeo.org
Fri May 5 06:18:48 PDT 2017


Author: martinl
Date: 2017-05-05 06:18:48 -0700 (Fri, 05 May 2017)
New Revision: 71029

Modified:
   grass-addons/grass7/raster/r.vect.stats/r.vect.stats.py
Log:
r.vect.stats: skip NULL values if column is given

Modified: grass-addons/grass7/raster/r.vect.stats/r.vect.stats.py
===================================================================
--- grass-addons/grass7/raster/r.vect.stats/r.vect.stats.py	2017-05-05 13:17:31 UTC (rev 71028)
+++ grass-addons/grass7/raster/r.vect.stats/r.vect.stats.py	2017-05-05 13:18:48 UTC (rev 71029)
@@ -47,13 +47,16 @@
     method = 'n'
     z = 3
     sep = 'pipe'
+    out_args = {}
     if options['column']:
         method = options['method']
         z = 4
-
+        out_args['column'] = options['column']
+        out_args['where'] = '{} IS NOT NULL'.format(options['column'])
+        
     out_process = gs.pipe_command(
         'v.out.ascii', input=vector, layer=layer, format='point',
-        column=options['column'], separator=sep)
+        separator=sep, **out_args)
     in_process = gs.start_command(
         'r.in.xyz', input='-', output=raster, method=method, z=z,
         separator=sep, stdin=out_process.stdout)



More information about the grass-commit mailing list