james-willis commented on code in PR #1073:
URL: https://github.com/apache/sedona-db/pull/1073#discussion_r3647468791


##########
rust/sedona-raster-functions/src/rs_spatial_predicates.rs:
##########
@@ -318,24 +316,54 @@ fn evaluate_predicate_with_crs<Op: tg::BinaryPredicate>(
     from_a_to_b: bool,
     engine: &dyn CrsEngine,
 ) -> Result<bool> {
-    // If either side has no CRS, compare directly without transformation.
-    let (crs_a, crs_b) = match (crs_a, crs_b) {
-        (Some(a), Some(b)) => (a, b),
-        (None, None) => return evaluate_predicate::<Op>(wkb_a, wkb_b),
-        (Some(_), None) => {
-            return exec_err!(
-                "Cannot evaluate spatial predicate: \
-                left geometry has CRS but right geometry does not"
+    match (crs_a, crs_b) {
+        (Some(crs_a), Some(crs_b)) => {
+            compare_in_crs::<Op>(wkb_a, crs_a, wkb_b, crs_b, from_a_to_b, 
engine)
+        }
+        // Neither side has a CRS: both are in the same (unknown) frame, so 
compare
+        // directly without transformation.
+        (None, None) => evaluate_predicate::<Op>(wkb_a, wkb_b),
+        // Exactly one side has a CRS: assume the missing side is WGS84 
(matching
+        // Sedona Spark) and compare in the resulting CRS pair. Only these arms
+        // materialize the lnglat CRS, so the common paths avoid the 
allocation.
+        (Some(crs_a), None) => {
+            let lnglat_crs = lnglat().expect("lnglat() should always return 
Some");

Review Comment:
   ok changed back



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