Skip to content
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

WIP: Experimental integration of viv loaders #1441

Closed
wants to merge 9 commits into from
Closed

Conversation

ibgreen
Copy link
Collaborator

@ibgreen ibgreen commented Jun 4, 2021

"@loaders.gl/worker-utils": "3.0.0-alpha.18",
"fast-deep-equal": "^3.1.3",
"fast-xml-parser": "^3.16.0",
"geotiff": "ilan-gold/geotiff.js#ilan-gold/viv_094",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ilan-gold is your geotiff fork still required?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you want the abort signals and reliable LZW (de)compression, then yes. I think those are the only two differences.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am trying to get the first issue resolved. The second one is a bit hairier because it uses @manzt 's compiled-from-rust lzw decoder as well as a small change to the decompressor function

Copy link
Collaborator

@manzt manzt Jun 4, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Primary issue here is that the decoders for geotiff.js are baked into the library. In Zarr.js we a global registry which allows you to swap in/out different codec implementations, as well as allow for dynamic loading of compression modules (you have the option to only "pay" for the codecs that get used at runtime). In contrast, geotiff JS getDecoder function wraps a complete set of decoders and aren't tree-shakeable. geotiffjs/geotiff.js#172 (comment)

@@ -1,7 +1,7 @@
# @loaders.gl/textures
# @loaders.gl/tiff
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: If we have both zarr and tiff loaders in this module, there might be a better name; maybe @loaders.gl/array? We could also move the NPYLoader from its temporary location in @loaders.gl/terrain to this new module.

Edit: Didn't realize NPYLoader now resided in @loaders.gl/textures. Here with TIFF and Zarr might still be a better option.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess one question is; do we care strongly about the bundle size of this module for script usage when it won't be tree shaken?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed that @loaders.gl/array could be a good move. We might be able to unify interfaces for in-memory multi- dimensional/scale arrays.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I already split into modules/tiff and modules/zarr

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We might be able to unify interfaces for in-memory multi- dimensional/scale arrays.

Maybe we should spend some time discussing a consistent output format first for zarr, tiff, and npy, similar to what we're doing in #1430

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have a strong preference on whether tiff and zarr should be in one module or two, though I do feel that the NPYLoader is closer to both tiff and zarr than it is to the other special GPU texture formats in @loaders.gl/textures.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems different to me. The tiff and zarr modules provide a tile source interface, whereas the numpy loader decodes a single tile?

test/modules.js Outdated Show resolved Hide resolved
modules/tiff/package.json Outdated Show resolved Hide resolved
@@ -0,0 +1,74 @@
declare module 'geotiff' {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would geotiff.js upstream be interested in a PR to add this to a .d.ts file? I didn't see a relevant issue.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure. The types are relatively incomplete (there is a much larger un-typed API). Maybe worth opening an issue.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines +35 to +37
"dependencies-disabled": {
"geotiff": "ilan-gold/geotiff.js#ilan-gold/viv_094"
},
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any docs on this? I can't seem to find any on a quick search

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Docs on what? I just moved it to an unused key - think of it as a comment.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I thought dependencies-disabled had a specific meaning in package.json, something like installing the dependencies for upstream geotiff below but then replacing the geotiff code with Ilan's fork.

@manzt
Copy link
Collaborator

manzt commented Jun 4, 2021

@ibgreen I went ahead and stripped out all OME-specific metadata handling from the zarr module. What's the preferred way for me to add/suggest these changes?

@kylebarron
Copy link
Collaborator

@ibgreen I went ahead and stripped out all OME-specific metadata handling from the zarr module. What's the preferred way for me to add/suggest these changes?

Maybe simplest to make a PR onto this branch?

@ibgreen
Copy link
Collaborator Author

ibgreen commented Jun 4, 2021

What's the preferred way for me to add/suggest these changes?

A gentle git push or a PR will do fine.

@ibgreen
Copy link
Collaborator Author

ibgreen commented Jun 6, 2021

Moved geotiff (landed) and zarr to separate PRs.

@ibgreen ibgreen closed this Jun 6, 2021
@ibgreen ibgreen deleted the viv-loaders branch November 10, 2021 01:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants