Deferred tag reading

Open
#305 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Quiet
Tech stack
rust
Domain
data

Research direction

The issue names no repository files, tests, or entry points. Start by locating the TIFF tag-reading path and compare it with the linked cogeotiff implementation; done means non-inline tags are deferred and large tile offsets and byte counts are fetched only when needed for a tile.

Written by the indexing model from the issue text.

Description

It could be worth exploring an implementation of deferred tiff tag reading in this repo.

Right now, all tags are read up front, meaning that for large COGs we fetch a good amount of metadata before being able to do anything with the file. I'm thinking we should potentially change that so that tiff tags are instead deferred and loaded on demand for any non-inline tags.

Then for large tags like tile byte counts and tile offset, you don't even need to fetch those on demand, you can read just the element you need when reading a specific tile.

I'm fresh off implementing a client side viewer for cogs, where I implemented a speedup for viewing remote COGs where you don't need to fetch the entire COG header. https://github.com/developmentseed/deck.gl-raster/pull/529

The core implementation is in @cogeotiff/core

I'm thinking of having an enum to describe tag states, including "inline" and "deferred" tags. I.e. tiff tags can be inline, in the case of small tags (4 bytes in tiff or 8 bytes in bigtiff I think?) or for larger tags they're stored separately.

Dominant language
Rust
Stars
125
Forks
17
Avg merge
7h 33m
Merged PRs (30d)
8

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from developmentseed/async-tiff

All issues in developmentseed/async-tiff

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.