[GRASS-dev] Enhancement request: print name(s) of generated map(s) upon completion

Markus Neteler neteler at osgeo.org
Mon Jun 2 11:15:09 PDT 2014


Hi,

as general improvement I would like to see that each map generating GRASS
command prints the name(s) of the generated maps. This is especially
relevant when multiple maps can generated (e.g. r.watershed).

I have today added such support in v.vol.rst but wondered if a more generic
possibility exists at library level.
For raster maps, this ugly hack works:

Index: lib/raster/history.c
===================================================================
--- lib/raster/history.c (revision 60664)
+++ lib/raster/history.c (working copy)
@@ -162,6 +162,7 @@
  G_fatal_error(_("Unable to write history information for <%s>"), name);

     Rast__write_history(hist, fp);
+    G_done_msg(_("Raster map <%s> created"), name);
 }

Interestingly, it gets printed twice then:

# using GRASS 7.1.svn (nc_spm_08_grass7):~ >
r.mapcalc "result = if(landclass96 == 5, 1, null() )"
 100%
r.mapcalc complete. Raster map <result> created
r.mapcalc complete. Raster map <result> created

Likewise another example:

# using GRASS 7.1.svn (nc_spm_08_grass7):~ >
 g.region rast=elev_lid792_1m
r.watershed elevation=elev_lid792_1m accumulation=elev_lid792_1m.acc2 \
   basin=elev_lid792_1m.basin2 stream=elev_lid792_1m.stream2 \
   tci=elev_lid792_1m.tci2 threshold=1000
SECTION 1a (of 5): Initiating Memory.
SECTION 1b (of 5): Determining Offmap Flow.
 100%
...
SECTION 5: Closing Maps.
 100%
ram complete. Raster map <elev_lid792_1m.stream2> created
ram complete. Raster map <elev_lid792_1m.basin2> created
ram complete. Raster map <elev_lid792_1m.acc2> created
ram complete. Raster map <elev_lid792_1m.tci2> created
r.watershed complete. Raster map <elev_lid792_1m.acc2> created
r.watershed complete. Raster map <elev_lid792_1m.tci2> created
r.watershed complete. Raster map <elev_lid792_1m.basin2> created
r.watershed complete. Raster map <elev_lid792_1m.stream2> created

For vector maps, a similar mechanism would be ideal.

Ideas?

Markus
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-dev/attachments/20140602/f83f1ae8/attachment.html>


More information about the grass-dev mailing list