<div dir="ltr">Hi Rob,<br><br><div class="gmail_quote"><div dir="ltr">On Wed, Oct 10, 2018 at 11:12 AM Robert Coup <<a href="mailto:robert.coup@koordinates.com">robert.coup@koordinates.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div dir="ltr">Hi Sean,<div><br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div class="gmail_quote"><div>Configuration management doesn't have to be so bad. I have an example of how to do Rasterio-style configuration contexts, including reset, using GDAL's Python bindings at<br></div><div><br></div><div>  <a href="https://rasterio.readthedocs.io/en/latest/topics/configuration.html#gdal-example" target="_blank">https://rasterio.readthedocs.io/en/latest/topics/configuration.html#gdal-example</a></div></div></div></div></div></blockquote><div><br></div><div>(I love context managers)</div><div><br></div><div>How does it handle multiple open datasets with different configurations though? AFAIK underneath there's only one per-thread config in GDAL, not one per dataset? Or does it push/pop configurations every time you call the underlying GDAL functions?</div><div><br></div><div>Cheers,</div><div><br></div><div>Rob :)</div></div></div></div>
</blockquote></div><br clear="all"><div>I don't have a pushing and popping dataset wrapper handy, but I think that would work. In Python it would be something like the following right?</div><div><br></div><div>  wrapper = ConfigWrapper(gdal.Open(path), CPL_VSIL_CURL_ALLOWED_EXTENSIONS=".tif")</div><div>  data = wrapper.ReadAsArray()</div><div><br></div><div>With the wrapper pushing that config option before it delegates and popping it after. As near as I can tell, CPL_VSIL_CURL_ALLOWED_EXTENSIONS only influences the Open() and Stat() calls for /vsicurl, so maybe the above would be overkill. Calling ReadAsArray shouldn't trigger a scan of auxiliary files.</div><div><br></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Sean Gillies</div></div></div>