Skip to content

docs: say that tiles decode on the main thread without a decoder pool - #802

Merged
kylebarron merged 3 commits into
mainfrom
kyle/docs-decoder-pool
Nov 6, 2026
Merged

kylebarron merged 3 commits into
mainfrom
kyle/docs-decoder-pool

Conversation

@kylebarron

@kylebarron kylebarron commented Oct 26, 2026 •

Copy link
Copy Markdown
Member

Note

This PR was written by Claude (Claude Code), not by @kylebarron.

The docs describe decoding without a worker pool wrongly:

  • The fetchTile and read JSDoc, on both GeoTIFF and Overview, says that without a pool, "a new decoder will be created for each tile". In fact the tiles are decoded on the main thread.
  • The geotiff README says that "by default workers are created up to navigator.hardwareConcurrency". A DecoderPool creates workers only when it's given createWorker. Without one, it decodes on the main thread. The README also never showed how to pass a pool to fetchTile.

Main-thread decoding stays the default for @developmentseed/geotiff; the layers already use defaultDecoderPool().

Changes

  • fetchTile and read JSDoc (GeoTIFF and Overview): without a pool, tiles are decoded on the main thread. It links defaultDecoderPool as a pool to pass.
  • Overview.fetchTile's summary said it reads the full-resolution image. It reads the overview.
  • geotiff README: a snippet that passes defaultDecoderPool() to fetchTile. Then what happens with no pool, with defaultDecoderPool(), and with a DecoderPool that has no createWorker. It names read among the methods that take a pool.

Checked

  • geotiff and deck.gl-geotiff build and typecheck, and Biome is clean on the changed files.
  • TypeDoc resolves the new {@link defaultDecoderPool} links. It reports the same 17 warnings for geotiff as on main.
  • With strict on, the README snippet typechecks against this branch's build. Passing defaultDecoderPool without calling it fails, as it should.

🤖 Written by Claude Code

The fetchTile JSDoc said that without a pool "a new decoder will be
created for each tile", and the geotiff README said that workers are
created by default. Neither is true: without a pool, or with a
DecoderPool that has no createWorker, tiles decode on the main thread.

Also fix the summary of Overview.fetchTile, which said it reads the
full-resolution image, and COGLayer's pool prop, which named a
GeoTIFFLayer that no longer exists.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions github-actions Bot added the docs label Oct 26, 2026
@kylebarron

Copy link
Copy Markdown
Member Author

I'm not sure if we should merge this or just fix the default so it uses a thread pool

@kylebarron

Copy link
Copy Markdown
Member Author

Note

This comment was written by Claude (Claude Code), not by @kylebarron.

I'm not sure if we should merge this or just fix the default so it uses a thread pool

We settled this in chat: main-thread decoding stays the default for @developmentseed/geotiff, and this PR documents it. A worker-pool default would start a module Worker from new URL("./worker.js", import.meta.url) on every direct call. That fails in Node, which has no global Worker, and needs bundler setup such as Vite's worker.format: "es". The layers already pass defaultDecoderPool().

Since your comment:

🤖 Written by Claude Code

@kylebarron kylebarron left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

✅

@kylebarron
kylebarron merged commit df866de into main Nov 6, 2026
5 checks passed
@kylebarron
kylebarron deleted the kyle/docs-decoder-pool branch November 6, 2026 16:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant