Skip to content

feat(rust/sedona-raster-functions): add RS_Value#974

Draft
james-willis wants to merge 3 commits into
apache:mainfrom
james-willis:jw/rs-value
Draft

feat(rust/sedona-raster-functions): add RS_Value#974
james-willis wants to merge 3 commits into
apache:mainfrom
james-willis:jw/rs-value

Conversation

@james-willis

Copy link
Copy Markdown
Contributor

No description provided.

@github-actions github-actions Bot requested a review from prantogg June 17, 2026 21:13
Add RS_Value to sample a raster pixel value at a point or 1-based grid
cell (2-D). Reads materialised InDb pixel bytes directly from the band's
NdBuffer via stride-offset math and marks the UDF needs_pixels so the
planner injects RS_EnsureLoaded — no GDAL dependency. Returns null for
out-of-bounds locations and nodata pixels; errors on non-2-D bands.
Add RS_Value cases (grid, point, and point+band) to the consolidated
native-raster-functions Criterion bench, alongside the other RS_* kernels.
…d band handling

- Floor (not truncate toward zero) the inverse transform so a point just
  outside the top/left edge is out of bounds rather than sampling an edge pixel.
- Require a 2-D spatial (y, x) band via is_spatial_2d, not any two-axis band.
- Propagate a NULL band argument to a NULL result; reject band 0/negative
  rather than coercing to band 1.
- Document why the pixel read uses the lossless f64 conversion.
- Add tests: floor edge case, NaN nodata, band 0, and the point CRS-mismatch /
  non-point-geometry error paths.
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.

1 participant