Copilot commented on code in PR #2184:
URL: https://github.com/apache/sedona/pull/2184#discussion_r2238662941


##########
python/sedona/geopandas/geoseries.py:
##########
@@ -1470,7 +1470,28 @@ def buffer(
         single_sided=False,
         **kwargs,
     ) -> "GeoSeries":
-        spark_col = stf.ST_Buffer(self.spark.column, distance)
+        if single_sided:
+            # Reverse the following logic in 
common/src/main/java/org/apache/sedona/common/Functions.java buffer() to avoid 
negating the distance
+            #   if (bufferParameters.isSingleSided()
+            #       && (params.toLowerCase().contains("left") && radius < 0
+            #           || params.toLowerCase().contains("right") && radius > 
0)) {
+            #     radius = -radius;
+            #   }
+            side = "left" if distance >= 0 else "right"
+        else:
+            side = "both"
+        assert side in [
+            "left",
+            "right",
+            "both",
+        ], "singled-sided must be one of 'left', 'right', or 'both', True, or 
False"

Review Comment:
   There is a typo in the assertion message: 'singled-sided' should be 
'single-sided'.
   ```suggestion
           ], "single-sided must be one of 'left', 'right', or 'both', True, or 
False"
   ```



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