james-willis commented on code in PR #749:
URL: https://github.com/apache/sedona-db/pull/749#discussion_r3228754243
##########
rust/sedona-raster/src/traits.rs:
##########
@@ -15,120 +15,305 @@
// specific language governing permissions and limitations
// under the License.
+use std::borrow::Cow;
+
use arrow_schema::ArrowError;
+use sedona_schema::raster::BandDataType;
-use sedona_schema::raster::{BandDataType, StorageType};
-
-/// Metadata for a raster
-#[derive(Debug, Clone)]
-pub struct RasterMetadata {
- pub width: u64,
- pub height: u64,
- pub upperleft_x: f64,
- pub upperleft_y: f64,
- pub scale_x: f64,
- pub scale_y: f64,
- pub skew_x: f64,
- pub skew_y: f64,
+/// Zero-copy view into a band's N-D data buffer with layout metadata.
+///
+/// `shape`, `strides`, and `offset` describe the *visible* region in
+/// byte-stride terms — they are computed by composing the band's
+/// `source_shape` (the natural extent of `buffer`) with its `view`
+/// (the per-axis `(source_axis, start, step, steps)` slice spec). Stride
+/// can be zero (broadcast) or negative (reverse iteration), and may not be
+/// C-order. Consumers that need a flat row-major buffer should use
+/// `BandRef::contiguous_data()` instead.
+#[derive(Debug)]
+pub struct NdBuffer<'a> {
+ pub buffer: &'a [u8],
+ pub shape: &'a [u64],
+ pub strides: &'a [i64],
Review Comment:
done
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]