Explorar el Código

r.in.gdal: GDALGetCacheMax() is limited to 2GiB, define valid range for memory parameter

git-svn-id: https://svn.osgeo.org/grass/grass/branches/releasebranch_7_0@61363 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Neteler hace 11 años
padre
commit
4e4dc2e1c3
Se han modificado 1 ficheros con 2 adiciones y 0 borrados
  1. 2 0
      raster/r.in.gdal/main.c

+ 2 - 0
raster/r.in.gdal/main.c

@@ -101,6 +101,7 @@ int main(int argc, char *argv[])
     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();
@@ -206,6 +207,7 @@ int main(int argc, char *argv[])
     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_verbose_message(_("Using user memory cache size: %.1f MiB"), GDALGetCacheMax()/1024.0/1024.0);
     } else