paleolimbot commented on code in PR #253:
URL: https://github.com/apache/sedona-db/pull/253#discussion_r2474757467


##########
rust/sedona-raster/src/builder.rs:
##########
@@ -0,0 +1,1600 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+use arrow_array::BinaryViewArray;
+use arrow_array::{
+    builder::{
+        BinaryBuilder, BinaryViewBuilder, Float64Builder, ListBuilder, 
StringBuilder,
+        StringViewBuilder, StructBuilder, UInt32Builder, UInt64Builder,
+    },
+    Array, BinaryArray, Float64Array, ListArray, StringArray, StringViewArray, 
StructArray,
+    UInt32Array, UInt64Array,
+};
+use arrow_schema::{ArrowError, DataType, Field};
+use datafusion_common::error::Result;
+use sedona_schema::raster::{
+    band_indices, band_metadata_indices, bounding_box_indices, column, 
metadata_indices,
+    raster_indices, BandDataType, RasterSchema, StorageType,
+};
+
+/// Builder for constructing raster arrays with zero-copy band data writing
+pub struct RasterBuilder {
+    main_builder: StructBuilder,
+}
+
+/// 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,
+}
+
+/// Bounding box coordinates
+#[derive(Debug, Clone)]
+pub struct BoundingBox {
+    pub min_x: f64,
+    pub min_y: f64,
+    pub max_x: f64,
+    pub max_y: f64,
+}

Review Comment:
   > Raster bounding boxes are typically in EPSG:4326
   
   I didn't know this! If this is the case that should be labelled every place 
it's accessed (possibly even in the name of the accessor/column name in the 
raster) because this is an easy mistake to make (or highlighted here if I 
missed it!). I suppose the native bounding box can be calculated from the top 
left point and affine transform.
   
   We don't have a WGS84-only bounding box anywhere, so I think having this as 
its own `struct` is OK. Calling the fields `lon/lat` instead of `x/y` would be 
another way to avoid confusion.
   
   



-- 
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]

Reply via email to