petern48 commented on code in PR #2386:
URL: https://github.com/apache/sedona/pull/2386#discussion_r2422383890


##########
python/sedona/spark/geopandas/geoseries.py:
##########
@@ -966,13 +966,12 @@ def is_ring(self):
 
     @property
     def is_ccw(self):
-        # Implementation of the abstract method.
-        raise NotImplementedError(
-            _not_implemented_error(
-                "is_ccw",
-                "Tests if LinearRing geometries are oriented 
counter-clockwise.",
-            )
+        spark_expr = stf.ST_IsPolygonCCW(self.spark.column)

Review Comment:
   After seeing the test failures, I took a look at the 
[documentation](https://sedona.apache.org/latest-snapshot/api/sql/Function/#st_ispolygonccw)
 and 
[implementation](https://github.com/apache/sedona/blob/6dc39e753b9d2087d27d2a6072b95d3eda91c53f/common/src/main/java/org/apache/sedona/common/Functions.java#L1493-L1508)
 of `ST_IsPolygonCCW` function. Unfortunately, it doesn't look like 
`ST_IsPolygonCCW` will not work for us, since it only handles Polygons and 
returns False for all linestrings. Looking at the [shapely 
implementation](https://github.com/shapely/shapely/blob/458b8bf6e6b17c7515151a72f221738e86fce6b9/src/ufuncs.c#L141-L173)
 (which geopandas uses) `is_ccw` is a function with some custom logic, so there 
doesn't seem to be a direct function equivalent in Sedona currently.
   
   This doesn't seem very easy to implement, so I think it's better to skip 
this one for now. Sorry about that @yunchipang



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