Repository navigation
fix(gee): EE request-size model, bounded retry, explicit scale (DEMO-1 F10a) - #22
Merged
Merged
Conversation
… explicit scale (F10a) _coarsen_scale_for_budget counted ground area (cos(lat)) at 4 B/band, but getDownloadURL exports on a degree grid (no cos term) and server-side arithmetic is double precision. At 47 N that under-counted bytes ~2.9x, so the "33 m" Landsat 8 NDVI request for 01013500 was 57.8 MB > 50.3 MB. - shared size model for the single-request and tiled paths, 1.25 margin - on EE's size error: coarsen and retry, max 3, every attempt in upstream["gee_export"]; GEE_REQUEST_TOO_LARGE on exhaustion - additive scale= on fetch/fetch_batch and the GEE backend - 74 offline tests (41 fail on 0.2.10); CHANGELOG Unreleased entry Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…view fixes - fetch_raster and SoilGrids read bandTypes() for bytes/pixel (index and multiband composites keep 8 B); value and source recorded in upstream["gee_export"] - scale= on non-GEE products: ignored with a note, kept out of the cache key when no GEE product is in the chain - tests: provenance through unit conversion, multiband, SoilGrids; cache key checked through the real fetch() builder; DEM plans finer than an index Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
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.
Problem
DEMO-1 F10a: for basin 01013500, Landsat 8 NDVI (summer 2014), the auto-coarsened "33 m" request was 57.8 MB against EE's 50,331,648-byte limit and failed.
Root cause
getDownloadURLexports on EPSG:4326 and converts metres to degrees with 111,319.49 m/deg on both axes: no cos(lat). The old estimate used ground area (lon_km * cos(lat)), under-counting pixels by 1.47x at 47.2 N.Changes
bytes_per_pixeldefault 8, safety factor 1.25. Fish River 1 band: 38 m instead of 33 m.FetchResult.upstream["gee_export"], with a note when the scale differs.GEE_REQUEST_TOO_LARGEon exhaustion.scale=onfetch,fetch_batchand the GEE backend (cache key changes only when given;SCALE_INVALIDon bad values).Tests
tests/test_gee_export_size_budget.py: 74 offline tests, 41 fail on 0.2.10. Full offline suite: 989 passed, 56 deselected (live). No live EE or network call was made.Not verified
The 8 B assumption and the 11 % residual have not been checked against the live service. aihydro-tools does not pass
scaleyet.🤖 Generated with Claude Code