[GRASS-dev] [GRASS-SVN] r61363 - grass/branches/releasebranch_7_0/raster/r.in.gdal

Markus Neteler neteler at osgeo.org
Thu Sep 24 09:35:51 PDT 2015


On Thu, Sep 24, 2015 at 5:51 PM, Vaclav Petras <wenzeslaus at gmail.com> wrote:
> Hi Markus,
>
> On Wed, Jul 23, 2014 at 5:43 AM, <svn_grass at osgeo.org> wrote:
>>
>> Author: neteler
>> Date: 2014-07-23 02:43:05 -0700 (Wed, 23 Jul 2014)
>> New Revision: 61363
>>
>> Modified:
>>    grass/branches/releasebranch_7_0/raster/r.in.gdal/main.c
>> Log:
>> r.in.gdal: GDALGetCacheMax() is limited to 2GiB, define valid range for
>> memory parameter
>>
>> Modified: grass/branches/releasebranch_7_0/raster/r.in.gdal/main.c
>> ===================================================================
>> --- grass/branches/releasebranch_7_0/raster/r.in.gdal/main.c    2014-07-23
>> 09:33:12 UTC (rev 61362)
>> +++ grass/branches/releasebranch_7_0/raster/r.in.gdal/main.c    2014-07-23
>> 09:43:05 UTC (rev 61363)
>> @@ -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)");
>
>
> Any idea why 0-2047? r61362 message doesn't explain

See the "TODO" below.

> and in fact is related
> to r61364. Shouldn't options be changed to something like 1-, 0- or nothing?

1? for 1 MiB?

> No reason to have upper limit, or is there some?

Well, to avoid to crash the module... this is what I remember.

Markus

> Thanks,
> Vaclav
>
>>
>>      parm.target = G_define_option();
>> @@ -206,6 +207,7 @@
>>      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
>>
>> _______________________________________________
>> grass-commit mailing list
>> grass-commit at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/grass-commit
>
>


More information about the grass-dev mailing list