Skip to content

feat(rust/sedona-raster-zarr): derive georeferencing from coordinate arrays#954

Merged
paleolimbot merged 5 commits into
apache:mainfrom
james-willis:jw/zarr-coord-georeferencing
Jun 16, 2026
Merged

feat(rust/sedona-raster-zarr): derive georeferencing from coordinate arrays#954
paleolimbot merged 5 commits into
apache:mainfrom
james-willis:jw/zarr-coord-georeferencing

Conversation

@james-willis

Copy link
Copy Markdown
Contributor

No description provided.

…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.
@github-actions github-actions Bot requested a review from paleolimbot June 12, 2026 23:54
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).
@james-willis james-willis marked this pull request as ready for review June 15, 2026 18:14

@paleolimbot paleolimbot left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@paleolimbot paleolimbot merged commit 88c255e into apache:main Jun 16, 2026
17 checks passed
@paleolimbot paleolimbot added this to the 0.4.0 milestone Jun 18, 2026
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