[GRASS-SVN] r70698 - grass/branches/releasebranch_7_2/raster/r.external.out

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Feb 28 08:49:30 PST 2017


Author: neteler
Date: 2017-02-28 08:49:30 -0800 (Tue, 28 Feb 2017)
New Revision: 70698

Modified:
   grass/branches/releasebranch_7_2/raster/r.external.out/main.c
   grass/branches/releasebranch_7_2/raster/r.external.out/r.external.out.html
Log:
r.external.out: clarify description; manual: add example

Modified: grass/branches/releasebranch_7_2/raster/r.external.out/main.c
===================================================================
--- grass/branches/releasebranch_7_2/raster/r.external.out/main.c	2017-02-28 16:48:37 UTC (rev 70697)
+++ grass/branches/releasebranch_7_2/raster/r.external.out/main.c	2017-02-28 16:49:30 UTC (rev 70698)
@@ -237,7 +237,7 @@
     G_add_keyword(_("output"));
     G_add_keyword(_("external"));
     module->description =
-	_("Defines raster output format utilizing GDAL library.");
+	_("Redirects raster output to file utilizing GDAL library rather than storing in GRASS raster format.");
 
     parm.dir = G_define_option();
     parm.dir->key = "directory";

Modified: grass/branches/releasebranch_7_2/raster/r.external.out/r.external.out.html
===================================================================
--- grass/branches/releasebranch_7_2/raster/r.external.out/r.external.out.html	2017-02-28 16:48:37 UTC (rev 70697)
+++ grass/branches/releasebranch_7_2/raster/r.external.out/r.external.out.html	2017-02-28 16:49:30 UTC (rev 70698)
@@ -1,7 +1,10 @@
 <h2>DESCRIPTION</h2>
 
-<em>r.external.out</em> instructs GRASS to write raster maps as data
-files (e.g. GeoTIFF) using GDAL.
+<em>r.external.out</em> instructs GRASS GIS to write subsequently generated
+raster maps as data files (e.g. GeoTIFF) using GDAL instead of storing them
+in GRASS raster format in the current mapset.
+<p>
+Any new raster map is immediately written out through GDAL as a file.
 
 <h2>NOTES</h2>
 
@@ -13,8 +16,37 @@
 current mapset directory.
 
 
-<h2>EXAMPLE</h2>
+<h2>EXAMPLES</h2>
 
+<h3>Storing results from raster data analysis directly as GeoTIFF</h3>
+
+The module <em>r.external.out</em> is used to write out processing results
+directly in GeoTIFF format (any GDAL supported format can be used here):
+
+<div class="code"><pre>
+# define output directory for files resulting from GRASS calculation(s)
+# and target format:
+mkdir $HOME/gisoutput/
+r.external.out directory=$HOME/gisoutput/ format="GTiff"
+
+# prepare sample analysis
+g.region raster=elevation -p
+
+# perform GRASS calculation (here: filter by height, write > 120m, NULL otherwise)
+# this will store the output map directly as GeoTIFF, so we use .tif extension:
+r.mapcalc "elev_filt.tif = if(elevation > 120.0, elevation, null() )"
+
+# ...the "elev_filt.tif" is immediately written.
+
+# cease GDAL output connection and turn back to write out GRASS raster files:
+r.external.out -r
+
+# verify resulting file
+gdalinfo $HOME/gisoutput/elev_filt.tif
+</pre></div>
+
+<h3>Complete workflow using only external geodata while processing in GRASS GIS</h3>
+
 The module <em>r.external.out</em> can be used along with
 <em>r.external</em> to process external geodata in GRASS
 while writing out the results directly in GeoTIFF:



More information about the grass-commit mailing list