Skip to content

Add desktop GeoTIFF tile server for large-image support#1591

Open
mattdawkins wants to merge 1 commit intomainfrom
large-image-geo-tif
Open

Add desktop GeoTIFF tile server for large-image support#1591
mattdawkins wants to merge 1 commit intomainfrom
large-image-geo-tif

Conversation

@mattdawkins
Copy link
Member

Summary

  • Add a geotiff.js + sharp tile server to the Electron backend that reads GeoTIFF/tiled TIFF files and serves PNG tiles via Express routes (/api/tiles/metadata, /api/tiles/zxy/:level/:x/:y)
  • Wire the desktop import pipeline (beginMediaImport, loadMetadata) to detect TIFF MIME types and classify datasets as large-image
  • Provide getTiles() and getTileURL() in the desktop frontend API so the existing LargeImageAnnotator and GeoJS rendering work on desktop

Details

New file: tileServer.ts — Core tile reading module with LRU-cached GeoTIFF handles (max 10). Supports pyramidal TIFFs (multiple IFDs), non-pyramidal TIFFs (virtual zoom levels with downsampling), and 1/3/4-band raster data with auto-scaling for >8-bit depths.

Import pipeline — Single .tif files and directories containing TIFFs are detected and routed as large-image datasets. Each TIFF file becomes one frame in the dataset, with its absolute path used as the item ID for tile requests.

Build configgeotiff is bundled by webpack (pure JS, avoids ESM/CJS incompatibility with Electron 11). sharp is externalized as a native module.

Test plan

  • Import a single .tif file via desktop UI, verify tiled rendering with pan/zoom
  • Import a folder of .tif files, verify multi-frame playback
  • Draw and save annotations on a tiled TIFF, verify persistence on reload
  • Test with untiled (strip) TIFFs, single-band grayscale, and TIFFs without overviews
  • Verify existing image-sequence and video imports still work

🤖 Generated with Claude Code

Add geotiff.js and sharp-based tile server to the Electron backend that
reads GeoTIFF/tiled TIFF files and serves them as PNG tiles. Wire the
desktop import pipeline to recognize TIFF MIME types and classify them
as 'large-image' datasets, and provide getTiles/getTileURL API functions
so LargeImageAnnotator can render tiled imagery via GeoJS.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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.

1 participant