[GRASS-SVN] r72765 - grass/trunk/raster/r.compress

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Jun 4 05:41:23 PDT 2018


Author: mmetz
Date: 2018-06-04 05:41:23 -0700 (Mon, 04 Jun 2018)
New Revision: 72765

Modified:
   grass/trunk/raster/r.compress/main.c
Log:
r.compress: ignore GRASS VRT

Modified: grass/trunk/raster/r.compress/main.c
===================================================================
--- grass/trunk/raster/r.compress/main.c	2018-06-04 12:28:01 UTC (rev 72764)
+++ grass/trunk/raster/r.compress/main.c	2018-06-04 12:41:23 UTC (rev 72765)
@@ -30,7 +30,7 @@
  *
  * The normal G_open_cell(), and Rast_put_row() do the compression
  * This program must only check that the file is not a reclass file and
- * is not a GDAL-linked map.
+ * is not a GDAL-linked map or a GRASS VRT.
  *
  * The only trick is to preserve the support files
  *
@@ -141,6 +141,10 @@
 	G_warning(_("<%s> is a GDAL-linked map - can't (un)compress"), name);
 	return 1;
     }
+    if (G_find_file2_misc("cell_misc", "vrt", name, G_mapset())) {
+	G_warning(_("<%s> is a virtual raster map - can't (un)compress"), name);
+	return 1;
+    }
 
     map_type = Rast_map_type(name, G_mapset());
 
@@ -312,6 +316,10 @@
         G_message(_("<%s> is a GDAL-linked map"), name);
         return 1;
     }
+    if (G_find_file2_misc("cell_misc", "vrt", name, G_mapset())) {
+        G_message(_("<%s> is a virtual raster map"), name);
+        return 1;
+    }
     if (Rast_is_reclass(name, G_mapset(), rname, rmapset) > 0) {
         G_message(_("<%s> is a reclass file of map <%s> in mapset <%s>"),
                   name, rname, rmapset);
@@ -349,7 +357,8 @@
 
 	if (G_find_file2_misc("cell_misc", NULLC_FILE, name, G_mapset())) {
 	    G_message(_("<%s> has a compressed NULL file"), name);
-	} else {
+	}
+	else {
 	    G_message(_("<%s> has an uncompressed NULL file"), name);
 	}
     }



More information about the grass-commit mailing list