[Qgis-developer] GRASS Direct

John C. Tull jctull at gmail.com
Mon Dec 10 13:15:09 PST 2012


Hi Larry,

Thanks for weighing in. Comments below...

On Dec 10, 2012, at 1:08 PM, Larry Shaffer <larrys at dakotacarto.com> wrote:

> Hi John and Radim,
> 
> On Mon, Dec 10, 2012 at 1:53 PM, John C. Tull <jctull at gmail.com> wrote:
>> On Dec 10, 2012, at 12:44 PM, Radim Blazek <radim.blazek at gmail.com> wrote:
>> 
>>> The GRASS Direct is an environment developed within QGIS GRASS
>>> plugin/provider which makes it possible to run GRASS raster modules
>>> without GRASS mapset and without data conversion to GRASS format.
>>> Basically it is a library implementing GRASS data read/write function
>>> which is using QGIS providers to read/write data. In direct mode, the
>>> GRASS modules are run with this library instead of  the standard GRASS
>>> gis library.
>>> 
>>> The GRASS modules may be run in direct mode from GRASS Tools (which
>>> are now always enabled) if no mapset is opened. The interface is
>>> similar to the standard GRASS Tools apart that the region is selected
>>> in combo box in top of options (to be discussed) and the output is a
>>> GeoTIFF file. It is also possible to run GRASS modules in direct mode
>>> from a shell if some environment variables are set. You can see those
>>> variables printed in top of the output tab.
>>> 
>>> This is work in progress, so I was reluctant to announce that but
>>> because it had caused some compilation problems, it was necessary to
>>> explain a bit how it works. Currently there are only few modules
>>> enabled and you can find various problems. Especially it was only
>>> tested on Linux and most probably more fixes will be necessary on Mac
>>> and Windows.
>>> 
>>> I believe that GRASS Direct could also be used in SEXTANTE with a
>>> little work. It would be necessary however to distinguish modules
>>> which may be run in direct mode from those which may not (mostly
>>> vector modules).
>>> 
>>> Sorry for the problems I caused on Mac and Windows and many thanks to
>>> Jürgen and Larry for fixes.
>>> 
>>> Radim
>> 
>> Hi Radim,
>> 
>> This is a great new addition to QGIS, so thank you for you work on it.
>> 
>> I wanted to bring my comment I made elsewhere on my Mac testing into this, more appropriate thread:
>> 
>> I just tested one of the available modules on a local DEM file, and here is there error message that appeared when I ran it:
>> 
>> Cannot start module r.slope.aspect
>> command: /usr/local/Cellar/grass/6.4.2/grass-6.4.2/bin/r.slope.aspect --interface-description
>> 
>> ERROR: GISRC - variable not set
>> 
>> Note that I am running a version of grass installed locally, not from the application that William makes available.
> 
> Radim, awesome stuff! Thanks for the introduction on it. Looking
> forward to using this inside of SEXTANTE.
> 
> Getting the same thing as John here, but with Kyngchaos.com GRASS.
> When using the Kyngchaos.com GRASS, the app starts via an internal
> shell script that configures most of those GRASS env variables [0].
> 
> John, again we Mac users are up against shell environment not being
> transferred into QGIS. I really think having a spot in the app
> preferences to allow manually added/augmented env variables (like
> PATH, etc.) would be very handy indeed.

+1

> It could be kinda like setting up a build environment inside of
> QtCreator [1]. The nice thing about having such an env variable editor
> (besides setting up custom variables) is that it would allow both C++
> and Python components to inherit the env settings. Example: thereby
> giving SEXTANTE access to any custom external install location on the
> filesystem.

I don't know if you have tested sextante grass tools, but I cannot get anything to work, likely because of the same environment problems that we are seeing with GRASS Direct. If we could cut through this problem with a solution as you propose, that would be great.

> Note how slim the default passed environment is for Mac GUI apps in
> [1] (nothing like my .bash_profile, etc.).
> 
> I really think this needs addressed (especially for Mac users), and
> could benefit all platforms with further start up environment
> customization.

Again, +1 from me.

> Regards,
> 
> Larry
> 
> [0] http://grass.osgeo.org/grass64/manuals/variables.html
> [1] https://dl.dropbox.com/u/4058089/qgis/env-vars_like-in-qtcreator.pn

Cheers,
John


More information about the Qgis-developer mailing list