-
Notifications
You must be signed in to change notification settings - Fork 184
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added LERC_ZSTD decompression #397
Conversation
Hey @TheMrCam Thanks for supplying this integration! This is indeed very cool. Unfortunately, since the underlying (de-)compressor uses WASM, it seems to break testing. Do you think there is a way around this? |
Hello @constantinius, thanks for taking a look at this! WASM is definitely not my strong suit, but I assume there should be a way around it for testing since the package seems to work when integrated into my project. Also, the failed checks in CI all pass on my local machine. I'll dig around a bit to see what I can do. |
@TheMrCam I'll try an update to Node v20, which is the current LTS version, to see if the tests pass then. |
@TheMrCam Which node version are you using? How did you test locally? |
@constantinius The Node update results actually looks as I expected - I'm getting the same 6 test failures locally (on Node It looks like there's 3 separate issues that cause these tests to fail:
I believe these should all be fixable and am looking into it now, and I will update if my assessment changes. |
…Removed isomorphic-fetch dependency
@constantinius I believe I found the solution, or at least it now tests OK locally & still works great integrated into my package. I did also update the |
Thanks @TheMrCam! This looks very good |
I noticed that Planetary Computer COGs are compressed with
LERC_ZSTD
and could not be read bygeotiff.js
.I fumbled around a bit to figure out a working implementation of the Zstandard decoder since there's a couple Javascript ports, so I figured I'd make this PR in case it can be improved or merged.
The
zstddec
library utilizes WebAssembly (which I'm rather unexperienced with) and getting it properly initialized was the main pain point; I'm sure it could be cleaner but this appears to work for me.The
"DOM"
types in tsconfig appear to be necessary (based on microsoft/TypeScript-DOM-lib-generator#826) but there might be better options, I just did the quickest fix to get it building.I didn't notice until after I started on this that
addDecoder
could override current decoder implementations, but I'm struggling with getting that working in my own project and including this in an official release would make my job a smidge easier.