Skip to content

Move OpenLandMap COG windowing into src, add a download test - #481

Open
xkykai wants to merge 6 commits into
mainfrom
xk/openlandmap-cog-window-src
Open

xkykai wants to merge 6 commits into
mainfrom
xk/openlandmap-cog-window-src

Conversation

@xkykai

@xkykai xkykai commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator

The windowed COG reader's coordinate math, integer decoding, and geotransform validation are plain arithmetic, so they move from ext/NumericalEarthArchGDALExt.jl into src/DataWrangling/OpenLandMap/ and are now unit-testable without ArchGDAL loaded. The extension keeps only the GDAL I/O.

New in src:

  • validate_geographic_northup(geotransform) — axis-aligned, north-up check
  • validate_epsg4326(epsg) — accepts nothing or 4326
  • cog_window_indices(geotransform, width, height, bbox) → (xoff, yoff, xsize, ysize)
  • assemble_cog_window(raw, geotransform, xoff, yoff, scale, offset, nodata) → (longitude, latitude, data)

Behavior is unchanged: same window, coordinates, decoding, and NetCDF output.

Also adds test/test_openlandmap_downloading.jl, a live /vsicurl read over a small Iowa window, excluded from the default suite like the other *_downloading tests.

🤖 Generated with Claude Code

The coordinate math, integer decoding, and geotransform validation behind the
windowed COG reader are plain arithmetic on a geotransform and a raw array, so
they now live in src/DataWrangling/OpenLandMap and can be unit-tested without
ArchGDAL loaded. The extension keeps only the GDAL I/O.

Also adds a network-gated download test over a small Iowa cropland window,
excluded from the default suite like the other *_downloading tests.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@codecov

codecov Bot commented Jul 30, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.56098% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
ext/NumericalEarthArchGDALExt/gdal_utils.jl 80.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

xkykai added 2 commits August 11, 2026 10:38
# Conflicts:
#	ext/NumericalEarthArchGDALExt.jl
#	test/runtests.jl
…ndow-src

# Conflicts:
#	ext/NumericalEarthArchGDALExt/NumericalEarthArchGDALExt.jl
#	test/runtests.jl
@xkykai
xkykai marked this pull request as ready for review August 11, 2026 09:38
@xkykai
xkykai requested a review from glwagner August 11, 2026 09:39

This branch has not been deployed

No deployments
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.

2 participants