Shapefile.jl icon indicating copy to clipboard operation
Shapefile.jl copied to clipboard

Implement a `.zip` writer

Open asinghvi17 opened this issue 1 year ago • 5 comments

This would be as simple as amending the function here https://github.com/JuliaGeo/Shapefile.jl/blob/69bad032c3caef938c5f020ba39107e53a7ac593/src/writer.jl#L93 to switch behaviour based on the file name and return ZipFile file descriptors instead. This would be similar to the behaviour we introduced in .zip reading.

See https://github.com/fhs/ZipFile.jl/blob/a599b0aac5d17403fdbbc4ea63612be299cf8417/src/ZipFile.jl#L14-L1 for some example code that can do this, it seems quite straightforward.

asinghvi17 avatar Jun 13 '24 15:06 asinghvi17

Only half joking, ideally we dumb down/nag about Shapefile writes, and default/advice to things like geopackage instead. And post about http://switchfromshapefile.org/

evetion avatar Jul 02 '24 08:07 evetion

Probably we need a native geopackage writer first ;)

rafaqz avatar Jul 02 '24 09:07 rafaqz

Fair point, let's add it to the board and put it higher prio than this zip writer :)

evetion avatar Jul 02 '24 10:07 evetion

The reader in GeoPackage.jl semi works, it just needs to be cleaned up a lot + optimized :D. I'm not sure about the writer though, that seems like a lot of work...

asinghvi17 avatar Jul 02 '24 10:07 asinghvi17

So that you know, ZipFile.jl can be super slow when compressing large files: https://discourse.julialang.org/t/file-zipping-taking-longer-for-large-files/115963.

I made https://github.com/JuliaIO/ZipArchives.jl to save Zarr data in a .zip file, but it might also be useful here.

nhz2 avatar Jul 02 '24 13:07 nhz2