[GRASS-SVN] r70043 - grass-addons/grass7/temporal/t.rast.out.xyz

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Dec 9 01:13:27 PST 2016


Author: lucadelu
Date: 2016-12-09 01:13:27 -0800 (Fri, 09 Dec 2016)
New Revision: 70043

Modified:
   grass-addons/grass7/temporal/t.rast.out.xyz/t.rast.out.xyz.html
   grass-addons/grass7/temporal/t.rast.out.xyz/t.rast.out.xyz.py
Log:
t.rast.out.xyz: added i parameter to support null values in the output, updated manual

Modified: grass-addons/grass7/temporal/t.rast.out.xyz/t.rast.out.xyz.html
===================================================================
--- grass-addons/grass7/temporal/t.rast.out.xyz/t.rast.out.xyz.html	2016-12-09 09:09:23 UTC (rev 70042)
+++ grass-addons/grass7/temporal/t.rast.out.xyz/t.rast.out.xyz.html	2016-12-09 09:13:27 UTC (rev 70043)
@@ -3,6 +3,15 @@
 The t.rast.out.xyz module exports a space time raster dataset as a list
 of x,y,z values into an ASCII text file.
 
+<h2>NOTES</h2>
+
+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.
+
+<em>t.rast.out.xyz</em> is simply a front-end to "<tt>r.out.xyz</tt>".
+
 <h2>EXAMPLE</h2>
 
 <div class="code"><pre>
@@ -16,4 +25,4 @@
 
 <h2>AUTHOR</h2>
 
-Luca Delucchi (Fondazione Edmund Mach)
\ No newline at end of file
+Luca Delucchi, <i>Fondazione Edmund Mach</i>

Modified: grass-addons/grass7/temporal/t.rast.out.xyz/t.rast.out.xyz.py
===================================================================
--- grass-addons/grass7/temporal/t.rast.out.xyz/t.rast.out.xyz.py	2016-12-09 09:09:23 UTC (rev 70042)
+++ grass-addons/grass7/temporal/t.rast.out.xyz/t.rast.out.xyz.py	2016-12-09 09:13:27 UTC (rev 70043)
@@ -39,6 +39,11 @@
 #%option G_OPT_F_SEP
 #%end
 
+#%flag
+#% key: i
+#% description: Include no data values
+#%end
+
 import grass.script as gscript
 import grass.temporal as tgis
 
@@ -48,6 +53,9 @@
     out_name = options["output"]
     where = options["where"]
     sep = options["separator"]
+    donodata = ''
+    if flags['i']:
+        donodata = 'i'
     # Make sure the temporal database exists
     tgis.init()
     # We need a database interface
@@ -63,7 +71,7 @@
     mapnames = [mapp.get_name() for mapp in maps]
     try:
         gscript.run_command("r.out.xyz", input=','.join(mapnames),
-                            output=out_name, separator=sep,
+                            output=out_name, separator=sep, flags=donodata,
                             overwrite=gscript.overwrite())
         gscript.message(_("Space time raster dataset {st} exported to "
                           "{pa}".format(st=strds, pa=out_name)))



More information about the grass-commit mailing list