Toblerity / Fiona

Fiona reads and writes geographic data files
https://fiona.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
1.14k stars 201 forks source link

Install new VSI plugin handler for every instance of using an opener #1408

Closed sgillies closed 1 week ago

sgillies commented 2 weeks ago

Resolves #1406 by giving each fiona.open() collection its own VSI plugin handler when the opener keyword argument is used. Works with threads.

The approach is not unlike the one mentioned in https://github.com/OSGeo/gdal/pull/8772 and benefits from the VSIRemovePluginHandler() function added in GDAL 3.9.0. With older versions of GDAL, the Pyopener registry will accumulate openers and GDAL will accumulate plugin handlers.

This PR also adds and uses Rasterio's chaining error handler and error stack checker.