[GRASS-SVN] r58668 - grass/trunk/imagery/i.group

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Jan 10 08:35:43 PST 2014


Author: martinl
Date: 2014-01-10 08:35:43 -0800 (Fri, 10 Jan 2014)
New Revision: 58668

Modified:
   grass/trunk/imagery/i.group/main.c
Log:
i.group: print warning instead of fatal error when input raster map not found


Modified: grass/trunk/imagery/i.group/main.c
===================================================================
--- grass/trunk/imagery/i.group/main.c	2014-01-10 16:24:34 UTC (rev 58667)
+++ grass/trunk/imagery/i.group/main.c	2014-01-10 16:35:43 UTC (rev 58668)
@@ -215,8 +215,11 @@
 
     for (m = 0; m < k; m++) {
 	skip = 0;
-	if ((mapset = G_find_raster(rasters[m], "")) == NULL)
-	    G_fatal_error(_("Raster map <%s> not found"), rasters[m]);
+	if ((mapset = G_find_raster(rasters[m], "")) == NULL) {
+	    G_warning(_("Raster map <%s> not found. Skipped."), rasters[m]);
+            skip = 1;
+            continue;
+        }
 
 	G_message(_("Adding raster map <%s> to group"),
 		  G_fully_qualified_name(rasters[m], mapset));
@@ -224,7 +227,7 @@
 	/* Go through existing files to check for duplicates */
 	for (n = 0; n < ref.nfiles; n++) {
 	    if (strcmp(rasters[m], ref.file[n].name) == 0) {
-		G_message(_("Raster map <%s> exists in group. Skipping..."),
+		G_message(_("Raster map <%s> exists in group. Skipped."),
 			  G_fully_qualified_name(rasters[m], mapset));
 		skip = 1;
 		continue;
@@ -254,9 +257,12 @@
 
     for (m = 0; m < k; m++) {
 	skip = 0;
-	if ((mapset = G_find_raster(rasters[m], "")) == NULL)
-	    G_fatal_error(_("Raster map <%s> not found"),
-			  G_fully_qualified_name(rasters[m], mapset));
+	if ((mapset = G_find_raster(rasters[m], "")) == NULL) {
+            G_warning(_("Raster map <%s> not found. Skipped."),
+                      rasters[m]);
+            skip = 1;
+            continue;
+        }
 
 	G_message(_("Adding raster map <%s> to subgroup"),
 		  G_fully_qualified_name(rasters[m], mapset));



More information about the grass-commit mailing list