Closed brendan-ward closed 1 year ago
@brendan-ward sorry for the late review...
Looks nice!
I only try to support a handful of drivers, so not really important for me, but I'm doing some driver-specific stuff when writing in geofileops, so probably other people will do so as well? The detect_driver
API is also pretty straightforward, so I also think it won't be difficult to keep it stable. Just not sure if it wouldn't be better to make it explicit in the function name that it will only return writable drivers?
Conclusion: exposing it as a public function sounds like a good idea to me, possibly with a slightly different name.
Probably it will be a good idea to revisit DRIVERS
vs DRIVERS_EXT
vs ALL_EXTS
once upon a time now they are all only supporting the tests... but that's definitely not something for this PR.
Resolves #220 Supersedes #268
This adds support to use GDAL directly to detect supported write drivers based on a path, instead of using the hard-coded list we had previously.
This moves the
detect_driver
function to core; we may want to expose this as part of the public API for use in GeoPandas but I did not yet do so (let me know if this is a good idea).As part of this, I had to rearrange a few things that are not part of the public API:
_preprocess_options_key_value
moved toutil.py
to avoid a circular import issue; it is more utility-oriented anywayDRIVERS
was moved to the testing side, which is the only other place we were using it directly besides extension to driver detection. This wasn't part of the official public API, so hopefully this is not a breaking change, but we can mention it in the changelog if you think appropriate.