Kontinuation commented on code in PR #590:
URL: https://github.com/apache/sedona-db/pull/590#discussion_r2793626497


##########
rust/sedona-raster-functions/src/rs_srid.rs:
##########
@@ -167,26 +138,14 @@ impl SedonaScalarKernel for RsCrs {
             StringBuilder::with_capacity(executor.num_iterations(), 
preallocate_bytes);
 
         executor.execute_raster_void(|_i, raster_opt| {
-            match raster_opt {
-                None => builder.append_null(),
-                Some(raster) => match raster.crs() {
-                    None => builder.append_null(),
-                    Some(crs_str) => {
-                        let crs = deserialize_crs(crs_str).map_err(|e| {
-                            DataFusionError::Execution(format!("Failed to 
deserialize CRS: {e}"))
-                        })?;
-
-                        let crs_string = crs
-                            .ok_or_else(|| {
-                                DataFusionError::Execution(
-                                    "Failed to parse non-null CRS 
string".to_string(),
-                                )
-                            })?
-                            .to_crs_string();
-                        builder.append_value(crs_string);
-                    }
-                },
-            }
+            let Some(raster) = raster_opt else {
+                builder.append_null();
+                return Ok(());
+            };
+
+            // This is similar to ST_CRS: if no CRS is set, return "0"
+            let crs_str = raster.crs().unwrap_or("0");
+            builder.append_value(crs_str);

Review Comment:
   I think we should make RS_CRS consistent with ST_CRS. If this is not the 
case before, we have fixed it here.



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