[GRASS-SVN] r61362 - grass/trunk/raster/r.in.gdal

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Jul 23 02:33:12 PDT 2014


Author: neteler
Date: 2014-07-23 02:33:12 -0700 (Wed, 23 Jul 2014)
New Revision: 61362

Modified:
   grass/trunk/raster/r.in.gdal/main.c
Log:
r.in.gdal: predefine 300 MiB as default cache size; msg cosmetics

Modified: grass/trunk/raster/r.in.gdal/main.c
===================================================================
--- grass/trunk/raster/r.in.gdal/main.c	2014-07-23 09:16:45 UTC (rev 61361)
+++ grass/trunk/raster/r.in.gdal/main.c	2014-07-23 09:33:12 UTC (rev 61362)
@@ -101,6 +101,7 @@
     parm.memory->key = "memory";
     parm.memory->type = TYPE_INTEGER;
     parm.memory->required = NO;
+    parm.memory->options = "0-2047";
     parm.memory->description = _("Cache size (MiB)");
 
     parm.target = G_define_option();
@@ -204,13 +205,13 @@
     /*      Fire up the engines.                                            */
     /* -------------------------------------------------------------------- */
     GDALAllRegister();
+    /* default GDAL memory cache size appears to be only 40 MiB, slowing down r.in.gdal */
     if (parm.memory->answer && *parm.memory->answer) {
+	   /* TODO: GDALGetCacheMax() overflows at 2GiB, implement use of GDALSetCacheMax64() */
            GDALSetCacheMax(atol(parm.memory->answer) * 1024 * 1024);
-           G_message(_("Using user memory cache size: %.1f MiB"), GDALGetCacheMax()/1024.0/1024.0);
-    } else
-        G_message(_("Using default GDAL memory cache size: %.1f MiB"), GDALGetCacheMax()/1024.0/1024.0);
+           G_verbose_message(_("Using memory cache size: %.1f MiB"), GDALGetCacheMax()/1024.0/1024.0);
+    }
 
-
     /* -------------------------------------------------------------------- */
     /*      List supported formats and exit.                                */
     /*         code from GDAL 1.2.5  gcore/gdal_misc.cpp                    */



More information about the grass-commit mailing list