feat: add COG writer with Perlin noise pixel generation#99
Draft
prantogg wants to merge 4 commits into
Draft
Conversation
- Add noise module: 2D Perlin noise generator (deterministic, spatially correlated) for realistic satellite imagery compression ratios - Add cog module: GDAL-based COG writer using MEM→COG create_copy workflow, gated behind 'cog-writer' feature flag - Single-band UInt8, ZSTD compressed, 256x256 internal tiling - Per-footprint UTM CRS, geotransform from footprint origin - Seed from (footprint_id, cog_id) ensures deterministic output - 24 tests passing (5 noise + 3 COG roundtrip/determinism tests)
- Hoist loop-invariant frequency/dimension divisions in generate_raster - Add generate_raster_into(&mut Vec<u8>) for buffer reuse across COGs - CogConfig now wraps FootprintConfig to eliminate duplicated dimensions - Add pixel readback assertion to roundtrip test (verifies non-trivial data) - Scope band borrow explicitly to clarify lifetime before create_copy
- All noise arithmetic now uses f32 (~2x throughput on ARM NEON) - Row-level y-axis values (grid cell, fractional offset, fade curve) are computed once per row and reused across all 1830 columns - Permutation lookups for p[xi] and p[xi+1] hoisted out of hash step - f32 precision is more than sufficient for UInt8 pixel output
- Add NUM_THREADS=ALL_CPUS to COG creation options - GDAL time per COG: 41.5ms → 15.8ms (2.6x faster) - Total: 54.6ms → 29.2ms per COG (1.87x end-to-end) - Add bench_cog example for profiling noise + COG write
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.
Summary
cog-writerfeature flag using MEM→COGcreate_copyworkflowStacked on
Test plan
cargo clippy -- -D warningscleancargo fmt --checkclean