[gdal-dev] CPLFreeConfig() in port/cpl_conv.cpp

Roger Bivand Roger.Bivand at nhh.no
Wed Dec 19 02:24:46 PST 2012


On Wed, 19 Dec 2012, Even Rouault wrote:

> Selon Roger Bivand <Roger.Bivand at nhh.no>:
>
>> Hi,
>>
>> I can get and set ConfigOptions using functions in port/cpl_conv.cpp, but I
>> have not found a way of unsetting a ConfigOption, only CPLFreeConfig() which
>> NULLs them all. I can also not see how to query which keys are set, so that
>> I could store their values, and re-instate them after blowing away all
>> options. In the long-running setting of rgdal in R, when GDAL/OGR may be
>> running for a whole session, it would be useful to have better control of
>> the ConfigOptions on the GDAL side. Am I missing something?
>
> Yes, to clear a config option, just CPLSetConfigOption(key, NULL). See
> http://www.gdal.org/cpl__conv_8h.html#aa0cd1a68fe4f2fc7874cd2da605c36ce

Fine, thanks - I was reading the code, rather than the documentation, 
which does answer my question (even in the header).

Roger

>
> However, there's no public way of getting which config options are defined
> though, partly because config option can be either defined with
> CPLSetConfigOption() or just obtained from the environmenet through getenv().
>
>>
>> Grateful for pointers,
>>
>> Roger
>>
>>
>>
>> -----
>> Roger Bivand
>> NHH Norwegian School of Economics, Bergen, Norway
>> --
>> View this message in context:
>>
> http://osgeo-org.1560.n6.nabble.com/CPLFreeConfig-in-port-cpl-conv-cpp-tp5023867.html
>> Sent from the GDAL - Dev mailing list archive at Nabble.com.
>> _______________________________________________
>> gdal-dev mailing list
>> gdal-dev at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>>
>
>
>

-- 
Roger Bivand
Department of Economics, NHH Norwegian School of Economics,
Helleveien 30, N-5045 Bergen, Norway.
voice: +47 55 95 93 55; fax +47 55 95 95 43
e-mail: Roger.Bivand at nhh.no



More information about the gdal-dev mailing list