[GRASS-SVN] r74402 - grass-addons/grass7/raster/r.texture.tiled

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Apr 18 23:30:49 PDT 2019


Author: mlennert
Date: 2019-04-18 23:30:49 -0700 (Thu, 18 Apr 2019)
New Revision: 74402

Modified:
   grass-addons/grass7/raster/r.texture.tiled/r.texture.tiled.html
   grass-addons/grass7/raster/r.texture.tiled/r.texture.tiled.py
Log:
r.texture.tiled: add mapset_prefix parameter to ensure unique mapset names when running the module several times in parallel


Modified: grass-addons/grass7/raster/r.texture.tiled/r.texture.tiled.html
===================================================================
--- grass-addons/grass7/raster/r.texture.tiled/r.texture.tiled.html	2019-04-18 20:56:20 UTC (rev 74401)
+++ grass-addons/grass7/raster/r.texture.tiled/r.texture.tiled.html	2019-04-19 06:30:49 UTC (rev 74402)
@@ -13,6 +13,12 @@
 <b>overlap</b> parameters. If <b>processes</b> is higher than one, these tiles 
 will be processed in parallel.
 
+<p>
+The <b>mapset_prefix</b> parameter allows to make sure that the temporary
+mapsets created during the tiled processing have unique names. This is useful
+if the user runs <em>r.texture.tiled</em> several times in parallel (e.g. in
+an HPC environment).
+
 <h2>NOTES</h2>
 
 The parameters for texture calculation are identical to those of 

Modified: grass-addons/grass7/raster/r.texture.tiled/r.texture.tiled.py
===================================================================
--- grass-addons/grass7/raster/r.texture.tiled/r.texture.tiled.py	2019-04-18 20:56:20 UTC (rev 74401)
+++ grass-addons/grass7/raster/r.texture.tiled/r.texture.tiled.py	2019-04-19 06:30:49 UTC (rev 74402)
@@ -78,6 +78,13 @@
 #% answer: 1
 #% required: yes
 #%end
+#
+#%option
+#% key: mapset_prefix
+#% type: string
+#% description: Mapset prefix
+#% required: no
+#%end
 
 
 import math
@@ -128,7 +135,11 @@
     height = int(options['tile_height'])
     overlap = math.ceil(windowsize/2.0)
     processes = int(options['processes'])
+    mapset_prefix = None
+    if options['mapset_prefix']:
+        mapset_prefix = options['mapset_prefix']
 
+
     kwargs = {'input' : inputraster,
               'output' : outputprefix,
               'size' : windowsize,
@@ -143,6 +154,7 @@
                        overlap=overlap,
                        processes=processes,
                        split=False,
+                       mapset_prefix=mapset_prefix,
                        **kwargs)
     grd.run()
 



More information about the grass-commit mailing list