Browse Source

cache parameter added

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@41615 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Neteler 15 years ago
parent
commit
3e2546c6b9
2 changed files with 16 additions and 5 deletions
  1. 9 1
      raster/r.in.gdal/main.c
  2. 7 4
      raster/r.in.gdal/r.in.gdal.html

+ 9 - 1
raster/r.in.gdal/main.c

@@ -67,7 +67,7 @@ int main(int argc, char *argv[])
     struct GModule *module;
     struct GModule *module;
     struct
     struct
     {
     {
-	struct Option *input, *output, *target, *title, *outloc, *band;
+	struct Option *input, *output, *target, *title, *outloc, *band, *memory;
     } parm;
     } parm;
     struct Flag *flag_o, *flag_e, *flag_k, *flag_f, *flag_l, *flag_c;
     struct Flag *flag_o, *flag_e, *flag_k, *flag_f, *flag_l, *flag_c;
 
 
@@ -101,6 +101,12 @@ int main(int argc, char *argv[])
     parm.band->required = NO;
     parm.band->required = NO;
     parm.band->description = _("Band to select (default is all bands)");
     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 = G_define_option();
     parm.target->key = "target";
     parm.target->key = "target";
     parm.target->type = TYPE_STRING;
     parm.target->type = TYPE_STRING;
@@ -185,6 +191,8 @@ int main(int argc, char *argv[])
     /*      Fire up the engines.                                            */
     /*      Fire up the engines.                                            */
     /* -------------------------------------------------------------------- */
     /* -------------------------------------------------------------------- */
     GDALAllRegister();
     GDALAllRegister();
+    if (parm.memory->answer && *parm.memory->answer)
+           GDALSetCacheMax(atol(parm.memory->answer) * 1024 * 1024);
 
 
 
 
     /* -------------------------------------------------------------------- */
     /* -------------------------------------------------------------------- */

+ 7 - 4
raster/r.in.gdal/r.in.gdal.html

@@ -113,8 +113,8 @@ projection read from the PROJ_INFO file of the location name
 
 
 <h2>NOTES</h2>
 <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>
 <p>
 The <em>r.in.gdal</em> command does support the following features, as long as 
 The <em>r.in.gdal</em> command does support the following features, as long as 
@@ -129,8 +129,7 @@ the underlying format driver supports it:
 Note that if the source has no colormap, r.in.gdal in GRASS 5.0 will emit
 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.
 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
 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
 <dt> Data Types
 <dd> Most GDAL data types are supported.  Float32 and Float64 type bands
 <dd> Most GDAL data types are supported.  Float32 and Float64 type bands
@@ -170,6 +169,10 @@ the points with i.rectify.<br>
 
 
 </dl>
 </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>
 <h3>Error Messages</h3>
 
 
 <i>"ERROR: Input map is rotated - cannot import."</i><br>
 <i>"ERROR: Input map is rotated - cannot import."</i><br>