Переглянути джерело

r.out.xyz: new -i flag to include no data values

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@70017 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Neteler 8 роки тому
батько
коміт
1070d0b7d3
2 змінених файлів з 15 додано та 4 видалено
  1. 5 3
      scripts/r.out.xyz/r.out.xyz.html
  2. 10 1
      scripts/r.out.xyz/r.out.xyz.py

+ 5 - 3
scripts/r.out.xyz/r.out.xyz.html

@@ -5,8 +5,10 @@ values into an ASCII text file.
 
 
 <h2>NOTES</h2>
 <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>
 <p>
 This module, as all GRASS raster modules, will export cells based on the
 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.
 current region settings. See the <em>g.region</em> module for details.
@@ -17,7 +19,7 @@ size row x column) containing z values.
 <em>r.out.xyz</em> can combine several input raster maps, which can be 
 <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.
 convenient when it comes to e.g. produce ASCII point cloud files.
 <p>
 <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>
 <h2>EXAMPLES</h2>
 
 

+ 10 - 1
scripts/r.out.xyz/r.out.xyz.py

@@ -32,6 +32,10 @@
 #%end
 #%end
 #%option G_OPT_F_SEP
 #%option G_OPT_F_SEP
 #%end
 #%end
+#%flag
+#% key: i
+#% description: Include no data values
+#%end
 
 
 import sys
 import sys
 from grass.script import core as grass
 from grass.script import core as grass
@@ -41,8 +45,13 @@ from grass.exceptions import CalledModuleError
 def main():
 def main():
     # if no output filename, output to stdout
     # if no output filename, output to stdout
     output = options['output']
     output = options['output']
+    donodata = flags['i']
 
 
-    parameters = dict(flags="1gn",
+    if donodata:
+	statsflags="1g"
+    else:
+	statsflags="1gn"
+    parameters = dict(flags=statsflags,
                       input=options['input'],
                       input=options['input'],
                       separator=options['separator'])
                       separator=options['separator'])
     if output:
     if output: