Conversation
314d54e to
20caf2d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue #, if available: n/a
Summary
Adds tile caching to the Cesium imagery pipeline so that previously tiled images load instantly without re-running the Docker-based tile generation process.
Problem
Every time an image was loaded into the Cesium viewer — even if it had already been tiled in a prior session — the full Docker pipeline was re-executed:
docker pullthe ctb-quantized-mesh imagegdalwarpthe image to EPSG:4326calculate_extents.pyto compute geographic boundsctb-tileto generate all tile PNGsOnly the raw S3 image download was cached; the expensive tiling steps were not.
Solution
src/data/tiles/imagery/<imageName>/instead of a flat shared directory. This prevents different images from overwriting each other's tiles and enables independent caching per image.src/data/tiles/imagery/<imageName>/.extents.json.convertImageToCesiumchecks for a valid.extents.jsonand at least one zoom-level directory. On a cache hit, it skips the entire Docker pipeline and loads the existing tiles directly into Cesium.Changes
src/utils/cesiumImagery.tsgetExtentsMetadataPath()— resolves the.extents.jsonpath for a tile cache directorygetCachedExtents()— validates cached metadata and tile directories; returns extents ornullsaveCachedExtents()— writes extents JSON to disk after tile generationconvertImageToCesium()— checks cache before running Docker; outputs tiles to per-image subdirectory; persists extents on completionChecklist
Before you submit a pull request, please make sure you have the following:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.