I am running a shell script for batch processing in GRASS 7 (calling it with sh [...sh] in the command line window), which creates a series of rasters through classifications, raster calculator and regression analysis. What I would like to do now is extend that script, so that it calculates the surface roughness of the resulting raster. r.roughness only works so far in GRASS 6, however. I have GRASS 6 installed as well.

Is it possible to call GRASS 6 and its extensions with the GRASS 7 command line without starting GRASS 6 or do I have to write a script that calls both programs from outside of either GRASS environments?

  • The basic set of environment variables used to define a GRASS session are the same in GRASS 6 and 7, so I don't think you can start GRASS 6 within GRASS 7 without making havok. I would use the batch processing setup to first build a 7 environment, do what you have to there, then redefine a 6 environment, and continue there. – Micha Sep 28 '13 at 17:00

The module needs to be ported to GRASS GIS 7, i.e. ideally rewritten as Python script. You may consider to contact the author for this (see manual page).

However: The script may still be run in GRASS 7 by just copying the files into the right places, i.e. into the scripts/ directory of the GRASS installation.

  • Hi! After some long trying around - I manage to get parts of the script to run in Grass 7. I found, however, Landserf to provide an even better solution for calculating terrain roughness. – Peter Dec 13 '13 at 7:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.