|
@@ -64,6 +64,7 @@ import sys
|
|
|
import os
|
|
|
import atexit
|
|
|
import math
|
|
|
+from string import split
|
|
|
import grass.script as grass
|
|
|
from grass.exceptions import CalledModuleError
|
|
|
|
|
@@ -84,7 +85,6 @@ def main():
|
|
|
global temp_dist, temp_val
|
|
|
|
|
|
input = options['input']
|
|
|
- output = options['output']
|
|
|
radius = float(options['radius'])
|
|
|
metric = options['metric']
|
|
|
old = options['old']
|
|
@@ -122,6 +122,16 @@ def main():
|
|
|
if not grass.find_file(input)['file']:
|
|
|
grass.fatal(_("Raster map <%s> not found") % input)
|
|
|
|
|
|
+ # Workaround for r.mapcalc bug #3475
|
|
|
+ # Mapcalc will fail if output is a fully qualified map name
|
|
|
+ out_name = split(options['output'], '@')
|
|
|
+ if len(out_name) == 2:
|
|
|
+ if out_name[1] != grass.gisenv()['MAPSET']:
|
|
|
+ grass.fatal(_("Output can be written only to the current mapset"))
|
|
|
+ output = out_name[0]
|
|
|
+ else:
|
|
|
+ output = out_name[0]
|
|
|
+
|
|
|
if shrink == False:
|
|
|
try:
|
|
|
grass.run_command('r.grow.distance', input=input, metric=metric,
|