Some drivers create multiple files and we cannot write them to an io.BytesIO object and have them correctly handled later, but GDAL creates these successfully within the in-memory directory that we use.
It would be possible to write these to the io.BytesIO object if we zipped the in-memory directory, and then write that zipfile to the io.BytesIO object.
We could handle this by adding a zipped=True (or similar) parameter to write() / write_arrow() / write_dataframe() functions.
Alternatively, it might be possible to pass in an open zipfile.ZipFile instance and write files / directories from the in-memory directory to it. Unclear if this would be simpler.
Follow-on to #397
Some drivers create multiple files and we cannot write them to an
io.BytesIO
object and have them correctly handled later, but GDAL creates these successfully within the in-memory directory that we use.It would be possible to write these to the
io.BytesIO
object if we zipped the in-memory directory, and then write that zipfile to theio.BytesIO
object.We could handle this by adding a
zipped=True
(or similar) parameter towrite()
/write_arrow()
/write_dataframe()
functions.Alternatively, it might be possible to pass in an open
zipfile.ZipFile
instance and write files / directories from the in-memory directory to it. Unclear if this would be simpler.