[GRASS-SVN] r42180 - grass/branches/releasebranch_6_4/raster/r.in.gdal

svn_grass at osgeo.org svn_grass at osgeo.org
Sat May 8 16:50:23 EDT 2010


Author: neteler
Date: 2010-05-08 16:50:22 -0400 (Sat, 08 May 2010)
New Revision: 42180

Modified:
   grass/branches/releasebranch_6_4/raster/r.in.gdal/description.html
   grass/branches/releasebranch_6_4/raster/r.in.gdal/main.c
Log:
memory parameter backported

Modified: grass/branches/releasebranch_6_4/raster/r.in.gdal/description.html
===================================================================
--- grass/branches/releasebranch_6_4/raster/r.in.gdal/description.html	2010-05-08 20:37:23 UTC (rev 42179)
+++ grass/branches/releasebranch_6_4/raster/r.in.gdal/description.html	2010-05-08 20:50:22 UTC (rev 42180)
@@ -115,8 +115,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>
 
@@ -132,8 +132,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
@@ -173,6 +172,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>

Modified: grass/branches/releasebranch_6_4/raster/r.in.gdal/main.c
===================================================================
--- grass/branches/releasebranch_6_4/raster/r.in.gdal/main.c	2010-05-08 20:37:23 UTC (rev 42179)
+++ grass/branches/releasebranch_6_4/raster/r.in.gdal/main.c	2010-05-08 20:50:22 UTC (rev 42180)
@@ -66,7 +66,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;
 
@@ -99,6 +99,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;
@@ -166,6 +172,8 @@
     /*      Fire up the engines.                                            */
     /* -------------------------------------------------------------------- */
     GDALAllRegister();
+    if (parm.memory->answer && *parm.memory->answer)
+           GDALSetCacheMax(atol(parm.memory->answer) * 1024 * 1024);
 
 
     /* -------------------------------------------------------------------- */



More information about the grass-commit mailing list