[GRASS-user] Looping in GRASS GUI and accessing GUI monitor from command line

Markus Metz markus.metz.giswork at googlemail.com
Mon Jun 20 05:27:46 EDT 2011


Hi Ralf

Ralf Schäfer:
> Hi Markus,
>
> thanks for your quick response!
>
>> the script you use draws all raster maps on the same monitor using the
>> current region extents. That means that the next d.rast command will
>> draw a new raster map on top of the raster map of the previous d.rast
>> command. If all raster maps have identical extents, you will in the
>> end only see the last map drawn.
>
> I apologize for being not specific enough. I have set the g.region to the total area of all raster maps (from a vector map) and plot single tiles of raster data (ASTER DEM). I use the "-o" flag so that I can see all plotted raster data, that works fine. So basically I combine the ASTER DEM tiles and this works with the loop.
>
> What I have not understood:
> -Can I plot from the Shell command line (Terminal on Mac OS X) in the wxGUI graphics window now (1 year ago it was not possible according to a post - but I am wondering whether there should not be a way to address the wxGUI - other commands on the Shell command line also affect the project in the wxGUI (region and project settings)?

No, it is not possible to use d.rast, d.vect and the like from CLI for
wxGUI. This is planned for GRASS 7.

> At the moment I can run the loop only in the SHell command line and  plot only in tcl/tk graphics window - not in the wxGUI graphics monitor.
>
>> 3) use the GUI (tcl/tk or wx) and manually add all your raster maps to
>> the layer manager, then (de-)activate the maps as needed.
>
> Yes, my question was here: Can I run the script loop somehow inside the wxGUI to automatise the opening of raster maps? Inside the wxGUI there is a "command console" in the GRASS GIS Layer manager.
> But not all commands that work on the Shell command line work in the wxGUI Command console - and I am wondering whether it is possible to construct a simple loop there. My script failed in the first step when I try to assign a variable:
>>> my=$(g.mlist type=rast pattern='E14' -r)

I could not find any documentation on the wxGUI command console
(shell? python? something else?), no idea what is supported and what
not.

Markus M


More information about the grass-user mailing list