assign_index: Add GeoTIFF & STAC metadata support#56
Merged
dcherian merged 5 commits intoxarray-contrib:mainfrom Nov 17, 2025
Merged
assign_index: Add GeoTIFF & STAC metadata support#56dcherian merged 5 commits intoxarray-contrib:mainfrom
assign_index: Add GeoTIFF & STAC metadata support#56dcherian merged 5 commits intoxarray-contrib:mainfrom
Conversation
assign_index: Add STAC metadata support
Member
|
The GeoTIFF specification uses these attributes to describe the spatial information. STAC uses the projection extension AFAIK - https://github.com/stac-extensions/projection - which has a transform attribute. |
Resolves xarray-contrib#55 This commit adds support for creating RasterIndex from STAC metadata (model_tiepoint and model_pixel_scale attributes) in addition to the existing GeoTransform and coordinate array methods. Changes: - Enhanced get_affine() to extract affine transforms from STAC metadata - Added validation that Z pixel scale must be 0 (2D rasters only) - STAC metadata attributes are automatically cleaned up after use - Improved error messages when coordinates lack explicit values - Added comprehensive test coverage for assign_index function 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Documents the decision-making logic and priority order used by assign_index() when detecting affine transformations from various metadata formats (GeoTransform, STAC proj:transform, GeoTIFF metadata, and coordinate arrays). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Add two new classmethods to RasterIndex: - from_tiepoint_and_scale: Create index from GeoTIFF metadata - from_stac_proj_metadata: Create index from STAC proj:transform Refactored affine transform extraction into reusable helper functions in lib.py that are used by both assign_index and the new classmethods: - affine_from_tiepoint_and_scale - affine_from_stac_proj_metadata This provides more flexible APIs for creating RasterIndex instances directly from metadata dictionaries. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
4a2994e to
ceaf718
Compare
61ea662 to
bf60b33
Compare
bf60b33 to
90bdde7
Compare
assign_index: Add STAC metadata supportassign_index: Add GeoTIFF & STAC metadata support
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.
Resolves #55
This commit adds support for creating RasterIndex from STAC metadata
(model_tiepoint and model_pixel_scale attributes) in addition to the
existing GeoTransform and coordinate array methods.
Changes:
🤖 Generated with Claude Code
Co-Authored-By: Claude noreply@anthropic.com