-
Notifications
You must be signed in to change notification settings - Fork 5
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
Web Worker support #8
Comments
I'm not quite sure what you mean - both viewer.copc.io and the Potree implementation for COPC/EPT use copc.js via web workers to decompress LAZ data without anything hacky going on. Can you be more specific with exactly what you are trying to accomplish and what issue you are running into? |
I'm implementing COPC support for the web library Giro3D. I would like to move the laz decompression part in a worker. The decompression occurs in |
All of the functions here are part of the public API. If you'd like to pull them apart and run some of those parts in a web worker, you can do so. This library provides building blocks and utility functions (and also works in NodeJS), so putting implementation details of composable functions into web workers would probably be out of scope here. For example, in Potree we pass a compressed LAZ buffer received from the If you specifically want
I just typed this up now as pseudo-code so do not expect it to work - but hopefully it demonstrates my point: that the building blocks you need to accomplish this via web worker are already part of the public API. |
Thanks ! I'll try that and inform how it goes |
export const Copc = {
create,
loadHierarchyPage,
loadPointDataBuffer,
loadPointDataView,
} That's why I couldn't "inject" my worker. If it were part of the public API, that would be great :) |
That's true, it's such a light wrapper that I probably wasn't sure it was worth exposing - since it's just a range fetch. So a more accurate code sample would use your COPC
But that can absolutely be added to the public API - no objections to that. |
Added, and published to npm as current latest version |
Thanks for your quick response ! |
Currently, AFAIK it is not possible to use copc.js with workers without some form of hack.
The most performance critical part seems to be the LAZ decompression (namely
Las.PointData.decompressChunk()
). This could very easily be done in a worker while keeping the API almost identical.I could try to setup a rough PR for discussion if you'd like.
The text was updated successfully, but these errors were encountered: