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


##########
rust/sedona-raster/src/outdb_uri.rs:
##########
@@ -0,0 +1,133 @@
+// 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.
+
+/// Parsed components of an outdb_uri.
+///
+/// The outdb_uri format is `scheme://path#fragment`, e.g.:
+/// - `geotiff://s3://bucket/file.tif#band=1`
+/// - `zarr://s3://bucket/store#temperature/0.0.0`
+///
+/// The scheme determines which loader to dispatch to.
+/// The path is the external resource location (what RS_BandPath returns to 
users).
+/// The fragment encodes loader-specific details (band id, chunk coords, etc.).
+/// Each loader defines its own fragment convention.
+///
+/// TODO: For formats like Zarr that may need complex metadata (array path, 
chunk
+/// coordinates, byte ranges), a simple key-value fragment may not be 
sufficient.
+/// If this becomes a limitation, consider switching the fragment to a JSON 
object
+/// or making the entire outdb_uri a JSON string for those formats.
+#[derive(Debug, PartialEq)]
+pub struct OutDbUri<'a> {
+    /// Loader scheme (e.g., "geotiff", "zarr")
+    pub scheme: &'a str,
+    /// External resource path (e.g., "s3://bucket/file.tif")
+    pub path: &'a str,
+    /// Loader-specific fragment (e.g., "band=1"), or None if absent
+    pub fragment: Option<&'a str>,
+}

Review Comment:
   I think that misses the point...mem is definitely a format (just like how in 
GDAL it's a driver) referring to a contiguous array with parameters that 
control how its elements are organized into an ndarray (offsets/strides or the 
GDAL parameterization of that with line/pixel/band offsets).
   
   (GDAL also has the concept of a memory store, which it calls vsimem).
   
   The follow up plan is fine though (except calling out `mem://`).



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