feat(rust/sedona-raster-zarr): derive georeferencing from coordinate arrays#954
Merged
paleolimbot merged 5 commits intoJun 16, 2026
Merged
Conversation
…arrays When a Zarr group has no `spatial:transform`, derive the geotransform from the spatial dimensions' 1-D coordinate arrays (the common CF / non-GeoZarr case) instead of falling back to identity pixel coordinates. Only regularly-spaced numeric coordinate arrays are usable: read the values, confirm a constant step, and synthesize the GDAL transform treating coordinates as cell centers (half-step shift to the cell edge). latitude/longitude-named axes additionally imply geographic EPSG:4326; generic y/x get the transform but no CRS (the coordinate space is unlabeled — attach one with RS_SetCRS). An explicit `spatial:transform` still wins; a declared CRS with neither a transform nor usable coordinate arrays still errors rather than silently using pixel coordinates.
State whether the derived-transform path kept a declared CRS, inferred one from the lat/lon dim names, or left it unset (with an RS_SetCRS hint).
…ecated store_chunk_elements `&[T]` implements IntoArrayBytes, so the typed element slice goes straight to store_chunk; drops the #[allow(deprecated)] on the fixture.
…oord arrays - regular_step rejects any non-finite value up front (an interior NaN/inf would slip past the per-gap check, since comparisons against NaN are always false). - Only derive a transform from a coordinate array whose length matches the data array's extent along that axis; a mismatch is a malformed coord variable that would yield a wrong scale, so ignore it (warn) and fall back. - Note the i64/u64 -> f64 cast is exact for realistic coordinate magnitudes.
…er derive Generalize the coord fixture to arbitrary dim names/values and add integration tests: generic y/x derives a transform but no CRS; an irregular axis falls back to the identity transform; and derivation works under an explicit arrays filter (coord arrays are opened by name, independent of the filter).
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.
No description provided.