On 02/06/14 20:15, Markus Neteler wrote:
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?

Sounds quite verbose to me. Why do we need this ? Maybe make this conditional to --verbose ?

Moritz
_______________________________________________
grass-dev mailing list
grass-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev

Reply via email to