1) First, you need to consult the r.topidx command of GRASS GIS:
With GRASS GIS:
The command is
r.topidx input=avauffe@tests_divers output=test_topixd
2) same with QGIS
The processing log
ALGORITHM|Thu Jun 26 2014 20:45:33|processing.runalg("grass:r.topidx","/Users/Shared/avauffe.tif","202086.577,205625.414407,88411.048,90534.3504441",0,"/Users/Shared/test.tif")
From the help:
input = /Users/Shared/avauffe.tif"
GRASS_REGION_PARAMETER = "202086.577,205625.414407,88411.048,90534.3504441"
GRASS_REGION_CELLSIZE_PARAMETER = 0
Output topographic index layer = /Users/Shared/test.tif"
If there is a problem, you will get the error message "Oops..."
To check:
When you use a GRASS command from processing, the processing Python module create first a batch file with the command, named "grass_batch_job.sh" (Linux, Mac OS X) or "grass_script.bat" (Windows) in the folder .../.qgis2/processing: :
Then it execute this command with the Python module subprocess ((Python script .../plugins/processing/algs/grass/GrassUtils.py)
What is the content of your batch file ?
The batch file with v.voronoi:
g.proj -c proj4="+proj=utm +zone=30 +ellps=intl +towgs84=-87,-98,-121,0,0,0,0 +units=m +no_defs"
v.in.ogr min_area=0.0001 snap=-1 dsn="/Users/Shared/telechargement/30_06_14/qgis-mac-2.4/QGIS_2.3-dev_SnoLeo.app/Contents/MacOS/../Resources/python/plugins/processing/tests/data" layer=points output=tmp1403985550269 --overwrite -o
g.region n=4458983.8488 s=4458921.97814 e=270855.745301 w=270778.60198 res=1
v.voronoi input=tmp1403985550269 output=output4973a4a8d42444ce8ac8de404e4b13b7 --overwrite
v.out.ogr -s -c -e -z input=output4973a4a8d42444ce8ac8de404e4b13b7 dsn="/var/folders/vu/vu099NovH-KZpE5TEa83BU+++TI/-Tmp-/processing/1b556bdecead4a11a31da2fc029aa67d" format=ESRI_Shapefile olayer=output type=auto
exit
comes from the script GrassUtils.py (line 353-392) to check if GRASS GIS is installed:
def checkGrassIsInstalled(ignorePreviousState=False):
if isWindows():
path = GrassUtils.grassPath()
if path == '':
return 'GRASS folder is not configured.\nPlease configure \
it before running GRASS algorithms.'
cmdpath = os.path.join(path, 'bin', 'r.out.gdal.exe')
if not os.path.exists(cmdpath):
return 'The specified GRASS folder does not contain a valid \
set of GRASS modules.\n' \
+ 'Please, go to the Processing settings dialog, and \
check that the GRASS\n' \
+ 'folder is correctly configured'
if not ignorePreviousState:
if GrassUtils.isGrassInstalled:
return
try:
from processing import runalg
result = runalg(
'grass:v.voronoi',
points(),
False,
False,
'270778.60198,270855.745301,4458921.97814,4458983.8488',
-1,
0.0001,
0,
None,
)
if not os.path.exists(result['output']):
return 'It seems that GRASS is not correctly installed and \
configured in your system.\nPlease install it before \
running GRASS algorithms.'
except:
s = traceback.format_exc()
return 'Error while checking GRASS installation. GRASS might not \
be correctly configured.\n' + s
GrassUtils.isGrassInstalled = True
This function is called when there is a problem and the command cannot be executed -> your grass_script.bat
GRASS seems to be correctly installed and configured
A solution ?
Use GRASS GIS directly (an not GRASS GIS from QGIS via processing) or the GRASS plugin