I'm using GRASS 7.0.3 on Windows 7 (part of the QGIS 2.14 distribution) with the extra installed add-on module r.catchment. I'm trying to use GRASS to calculate a catchment raster, but I keep getting this error related to the use of the r.reclass module by r.catchment (see output below).
Here are the GRASS commands that I execute:
v.in.ogr input=location_utm.shp output=V_LOCATION_UTM --overwrite --quiet
r.in.gdal input=astgtm_utm.img output=R_ASTGTM_UTM --overwrite --quiet
r.catchment elevation=R_ASTGTM_UTM start_points=V_LOCATION_UTM buffer=R_CATCHMENT sigma=15 area=100000000 map_val=1 --verbose
r.out.gdal input=R_CATCHMENT output=catchment.img
This is the output (and error) I am getting:
C:\Temp>r.catchment elevation=R_ASTGTM_UTM start_points=V_LOCATION_UTM buffer=R_CATCHMENT sigma=15 area=100000000 map_val=1 --verbose
There is already a MASK in place, and you have also selected to mask slope
values above 15.
The high slope areas (slope mask) will be temporarily added to current
MASKED areas for the calcualtion of the catchment geometry.
The original MASK will be restored when the module finishes
Wanted buffer area=100000000
step 1 of 4: Calculating cost surface
Calculating for time costs only
Creating optional slope mask
100%
Maximum cost distance value 58426 covers an area of 2243889760 square map
units
Commencing to find a catchment configuration.....
Catchment configuration found!
Cost cutoff 5671 produces a catchment of 100003308 square map units.
Creating output map
ERROR: Cannot open rules file <c:\users\xxx\appdata\local\temp\tmpeopqnp>
Traceback (most recent call last):
File "C:\Users\xxx\AppData\Roaming\GRASS7\addons/scripts/r.catchment.py", line 379, in <module>
main()
File "C:\Users\xxx\AppData\Roaming\GRASS7\addons/scripts/r.catchment.py", line 329, in main
output='cost.reclass.%s' % pid, rules=temp.name)
File "C:\PROGRA~1\QGISES~1\apps\grass\grass-7.0.3\etc\python\grass\script\core.py", line 394, in run_command
return handle_errors(returncode, returncode, args, kwargs)
File "C:\PROGRA~1\QGISES~1\apps\grass\grass-7.0.3\etc\python\grass\script\core.py", line 312, in handle_errors
returncode=returncode)
grass.exceptions.CalledModuleError: Module run None ['r.reclass', 'rules=c:\\users\\xxx\\appdata\\local\\temp\\tmpeopqnp', 'input=temporary.cost.9304', 'output=cost.reclass.9304'] ended with error
Process ended with non-zero return code 1. See errors in the (error) output.
I have no idea why this error occurs or how to solve this.