[GRASS-SVN] r70017 - grass/trunk/scripts/r.out.xyz

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Dec 6 14:05:06 PST 2016


Author: neteler
Date: 2016-12-06 14:05:06 -0800 (Tue, 06 Dec 2016)
New Revision: 70017

Modified:
   grass/trunk/scripts/r.out.xyz/r.out.xyz.html
   grass/trunk/scripts/r.out.xyz/r.out.xyz.py
Log:
r.out.xyz: new -i flag to include no data values

Modified: grass/trunk/scripts/r.out.xyz/r.out.xyz.html
===================================================================
--- grass/trunk/scripts/r.out.xyz/r.out.xyz.html	2016-12-06 18:50:37 UTC (rev 70016)
+++ grass/trunk/scripts/r.out.xyz/r.out.xyz.html	2016-12-06 22:05:06 UTC (rev 70017)
@@ -5,8 +5,10 @@
 
 <h2>NOTES</h2>
 
-This module will not export x,y coordinates for raster cells containing
-a NULL value. This includes cells masked by a raster MASK.
+This module will by default not export x,y coordinates for raster cells
+containing a NULL value. This includes cells masked by a raster MASK.
+Using the flag <b>-i</b> also these raster cells will be included in the
+exported data.
 <p>
 This module, as all GRASS raster modules, will export cells based on the
 current region settings. See the <em>g.region</em> module for details.
@@ -17,7 +19,7 @@
 <em>r.out.xyz</em> can combine several input raster maps, which can be 
 convenient when it comes to e.g. produce ASCII point cloud files.
 <p>
-<em>r.out.xyz</em> is simply a front-end to "<tt>r.stats -1gn</tt>".
+<em>r.out.xyz</em> is simply a front-end to "<tt>r.stats -1g[n]</tt>".
 
 <h2>EXAMPLES</h2>
 

Modified: grass/trunk/scripts/r.out.xyz/r.out.xyz.py
===================================================================
--- grass/trunk/scripts/r.out.xyz/r.out.xyz.py	2016-12-06 18:50:37 UTC (rev 70016)
+++ grass/trunk/scripts/r.out.xyz/r.out.xyz.py	2016-12-06 22:05:06 UTC (rev 70017)
@@ -32,6 +32,10 @@
 #%end
 #%option G_OPT_F_SEP
 #%end
+#%flag
+#% key: i
+#% description: Include no data values
+#%end
 
 import sys
 from grass.script import core as grass
@@ -41,8 +45,13 @@
 def main():
     # if no output filename, output to stdout
     output = options['output']
+    donodata = flags['i']
 
-    parameters = dict(flags="1gn",
+    if donodata:
+	statsflags="1g"
+    else:
+	statsflags="1gn"
+    parameters = dict(flags=statsflags,
                       input=options['input'],
                       separator=options['separator'])
     if output:



More information about the grass-commit mailing list