jiayuasu commented on code in PR #2726:
URL: https://github.com/apache/sedona/pull/2726#discussion_r2921210395


##########
python/sedona/spark/geopandas/base.py:
##########
@@ -772,11 +794,80 @@ def convex_hull(self):
         """
         return _delegate_to_geometry_column("convex_hull", self)
 
-    # def delaunay_triangles(self, tolerance=0.0, only_edges=False):
-    #     raise NotImplementedError("This method is not implemented yet.")
+    def delaunay_triangles(self, tolerance=0.0, only_edges=False):
+        """Return Delaunay triangulation of the vertices of each geometry.
 
-    # def voronoi_polygons(self, tolerance=0.0, extend_to=None, 
only_edges=False):
-    #     raise NotImplementedError("This method is not implemented yet.")
+        .. note::
+
+            Unlike geopandas, which collects all vertices across the
+            entire GeoSeries and computes a single triangulation, Sedona
+            computes the triangulation **per row**. Each input geometry
+            produces one ``GeometryCollection`` containing its triangles.
+            The output GeoSeries has the same length as the input.
+
+        Parameters
+        ----------
+        tolerance : float, default 0.0
+            Snapping tolerance for vertices to be considered equal.
+        only_edges : bool, default False
+            If True, return only the edges of the triangulation as a
+            MultiLineString. If False, return triangles as a
+            GeometryCollection of Polygons.
+
+        Returns
+        -------
+        GeoSeries
+
+        Examples
+        --------
+        >>> from sedona.spark.geopandas import GeoSeries
+        >>> from shapely.geometry import MultiPoint
+        >>> s = GeoSeries([MultiPoint([(0, 0), (1, 0), (0.5, 1)])])
+        >>> s.delaunay_triangles()
+        0    GEOMETRYCOLLECTION (POLYGON ((0 0, 0.5 1, 1 0...
+        dtype: geometry
+        """
+        return _delegate_to_geometry_column(
+            "delaunay_triangles", self, tolerance, only_edges
+        )
+
+    def voronoi_polygons(self, tolerance=0.0, extend_to=None, 
only_edges=False):
+        """Return Voronoi diagram of the vertices of each geometry.
+
+        .. note::
+
+            Unlike geopandas, which collects all vertices across the
+            entire GeoSeries and computes a single Voronoi diagram, Sedona
+            computes the diagram **per row**. Each input geometry produces
+            one ``GeometryCollection`` containing its Voronoi polygons.
+            The output GeoSeries has the same length as the input.
+
+        Parameters
+        ----------
+        tolerance : float, default 0.0
+            Snapping tolerance for vertices to be considered equal.
+        extend_to : Geometry, default None
+            Not supported in Sedona.
+        only_edges : bool, default False

Review Comment:
   Updated docstring to clarify that passing a non-None value raises 
`NotImplementedError`. Fixed in 546297d.



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