koi2000 commented on code in PR #48695:
URL: https://github.com/apache/doris/pull/48695#discussion_r2013319534


##########
be/src/vec/functions/functions_geo.cpp:
##########
@@ -660,10 +662,10 @@ struct StContains {
     }
 
     static void loop_do(StringRef& lhs_value, StringRef& rhs_value,
-                        std::vector<std::shared_ptr<GeoShape>>& shapes, int& i,
+                        std::vector<std::shared_ptr<GeoShape>>& shapes,

Review Comment:
   fixed



##########
be/src/vec/functions/functions_geo.cpp:
##########
@@ -672,43 +674,37 @@ struct StContains {
                 break;
             }
         }
-
-        if (i == 2) {
-            auto contains_value = shapes[0]->contains(shapes[1].get());
-            res->insert_data(const_cast<const char*>((char*)&contains_value), 
0);
-        }
+        auto relation_value = Func::evaluate(shapes[0].get(), shapes[1].get());
+        res->insert_data(const_cast<const char*>((char*)&relation_value), 0);

Review Comment:
   fixed



##########
be/src/geo/geo_types.cpp:
##########
@@ -75,6 +78,19 @@ static inline GeoParseStatus to_s2point(double lng, double 
lat, S2Point* point)
     return GEO_PARSE_OK;
 }
 
+static double compute_intersection_area(const S2Polygon* polygon1, const 
S2Polygon* polygon2) {
+    S2Polygon result;
+    S2BooleanOperation::Options options;
+    std::unique_ptr<s2builderutil::S2PolygonLayer> layer(
+            new s2builderutil::S2PolygonLayer(&result));
+    S2BooleanOperation op(S2BooleanOperation::OpType::INTERSECTION, 
std::move(layer));
+    S2Error error;

Review Comment:
   fixed



-- 
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: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to