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

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Mar 29 14:49:07 EDT 2010


Author: neteler
Date: 2010-03-29 14:49:05 -0400 (Mon, 29 Mar 2010)
New Revision: 41615

Modified:
   grass/trunk/raster/r.in.gdal/main.c
   grass/trunk/raster/r.in.gdal/r.in.gdal.html
Log:
cache parameter added

Modified: grass/trunk/raster/r.in.gdal/main.c
===================================================================
--- grass/trunk/raster/r.in.gdal/main.c	2010-03-29 13:30:01 UTC (rev 41614)
+++ grass/trunk/raster/r.in.gdal/main.c	2010-03-29 18:49:05 UTC (rev 41615)
@@ -67,7 +67,7 @@
     struct GModule *module;
     struct
     {
-	struct Option *input, *output, *target, *title, *outloc, *band;
+	struct Option *input, *output, *target, *title, *outloc, *band, *memory;
     } parm;
     struct Flag *flag_o, *flag_e, *flag_k, *flag_f, *flag_l, *flag_c;
 
@@ -101,6 +101,12 @@
     parm.band->required = NO;
     parm.band->description = _("Band to select (default is all bands)");
 
+    parm.memory = G_define_option();
+    parm.memory->key = "memory";
+    parm.memory->type = TYPE_INTEGER;
+    parm.memory->required = NO;
+    parm.memory->description = _("Cache size (MiB)");
+
     parm.target = G_define_option();
     parm.target->key = "target";
     parm.target->type = TYPE_STRING;
@@ -185,6 +191,8 @@
     /*      Fire up the engines.                                            */
     /* -------------------------------------------------------------------- */
     GDALAllRegister();
+    if (parm.memory->answer && *parm.memory->answer)
+           GDALSetCacheMax(atol(parm.memory->answer) * 1024 * 1024);
 
 
     /* -------------------------------------------------------------------- */

Modified: grass/trunk/raster/r.in.gdal/r.in.gdal.html
===================================================================
--- grass/trunk/raster/r.in.gdal/r.in.gdal.html	2010-03-29 13:30:01 UTC (rev 41614)
+++ grass/trunk/raster/r.in.gdal/r.in.gdal.html	2010-03-29 18:49:05 UTC (rev 41615)
@@ -113,8 +113,8 @@
 
 <h2>NOTES</h2>
 
-Planned improvements to <em>r.in.gdal</em> in the future include support for
-reporting everything known about a dataset if the <b>output</b> parameter is not set.
+Import of large files can be significantly faster when setting <b>memory</b> to
+the size of the input file.
 
 <p>
 The <em>r.in.gdal</em> command does support the following features, as long as 
@@ -129,8 +129,7 @@
 Note that if the source has no colormap, r.in.gdal in GRASS 5.0 will emit
 no colormap.  Use r.colors map=... color=grey to assign a greyscale colormap.
 In a future version of GRASS r.in.gdal will likely be upgraded to automatically
-emit greyscale colormaps.
-<br>
+emit greyscale colormaps.<br>
 
 <dt> Data Types
 <dd> Most GDAL data types are supported.  Float32 and Float64 type bands
@@ -170,6 +169,10 @@
 
 </dl>
 
+<p>
+Planned improvements to <em>r.in.gdal</em> in the future include support for
+reporting everything known about a dataset if the <b>output</b> parameter is not set.
+
 <h3>Error Messages</h3>
 
 <i>"ERROR: Input map is rotated - cannot import."</i><br>



More information about the grass-commit mailing list