فهرست منبع

Stop on failure of r.grow.distance

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@59235 15284696-431f-4ddb-bdfa-cd5b030d7da7
Maris Nartiss 11 سال پیش
والد
کامیت
34138cd1fb
1فایلهای تغییر یافته به همراه4 افزوده شده و 3 حذف شده
  1. 4 3
      scripts/r.grow/r.grow.py

+ 4 - 3
scripts/r.grow/r.grow.py

@@ -105,10 +105,11 @@ def main():
 
 
     #check if input file exists
     #check if input file exists
     if not grass.find_file(input)['file']:
     if not grass.find_file(input)['file']:
-        grass.fatal(_("<%s> does not exist.") % input)
+        grass.fatal(_("Map <%s> does not exist.") % input)
 
 
-    grass.run_command('r.grow.distance',  input = input, metric = metric,
-                      distance = temp_dist, value = temp_val)
+    if grass.run_command('r.grow.distance',  input = input, metric = metric,
+                      distance = temp_dist, value = temp_val) != 0:
+        grass.fatal(_("Growing failed. Removing temporary maps."))
 
 
     grass.mapcalc(
     grass.mapcalc(
         "$output = if(!isnull($input),$old,if($dist < $radius,$new,null()))",
         "$output = if(!isnull($input),$old,if($dist < $radius,$new,null()))",