[GRASS-user] programming an automated GRASS analysis with a custom interface

Hamish hamish_b at yahoo.com
Mon Sep 8 21:28:11 EDT 2008


Hufkens Koen wrote:
> I'm currently working on a project where it would be
> nice to have user friendly and above all limited interface
> to an automated GRASS routine. Is there a quick and easy way
> to call GRASS from within other code (preferably a fast
> scripting language)? Furthermore, is interaction possible if
> I'm able to call GRASS from within this code, as I would
> like to create a mask based upon user input?
> 
> Any suggestions?

You can automatically launch GRASS into an automated script using the
GRASS_BATCH_JOB environment variable. See the variables help page
('g.manual variables') for more info. With that typically you set
the location and mapset name from the command line.

Within GRASS you could have it call r.digit (Mac/*NIX only) or in
Python write some magic borrowed from the wxGUI to launch the vdigit
digitizer.

If using this on Mac/Linux/UNIX/Cygwin you can use xmon display monitors.
In that case you can script in the d.ask and d.menu modules for on-screen-
display interaction. It is my hope for GRASS 7 to have those rewritten to
throw up simple wxPy GUI interface windows. I think it is a nice feature
which gives non-programmers the ability to write interactive GUI'd scripts.


Also note you can pre-fill module GUIs by giving the options= and -f flags
you want on the command line and then using the --ui flag to force a GUI
window.

Perhaps the solutions are slightly klunky, but they should be functional.


Hamish



      



More information about the grass-user mailing list