Copilot commented on code in PR #128:
URL: https://github.com/apache/sedona-db/pull/128#discussion_r2370819295


##########
docs/reference/sql.md:
##########
@@ -609,229 +662,253 @@ Computes the symmetric difference between geomA and 
geomB.
 ### SQL Example
 
 ```sql
-SELECT ST_SymDifference(ST_GeomFromText('POLYGON ((1 1, 11 1, 1 11, 0 0))'), 
ST_GeomFromText('POLYGON ((0 0, 10 0, 0 10, 0 0))')) AS val
+SELECT ST_HausdorffDistance(ST_GeomFromText('POLYGON ((10 10, 11 10, 10 11, 10 
10))'), ST_GeomFromText('POLYGON ((0 0, 1 0, 0 1, 0 0))')) AS val
 ```
 
-## ST_Area
+-----
+
+## ST\_Intersection
 
 ### Description
 
-Return the area of a geometry.
+Computes the intersection between geomA and geomB.
 
 ### Format
 
-`ST_Area (A: Geometry)`
+`ST_Intersection (A: Geometry, B: Geometry)`
 
 ### Arguments
 
-  * **geom**: Input geometry.
+  * **geomA**: Input geometry or geography.
+  * **geomB**: Input geometry or geography.
 
 ### SQL Example
 
 ```sql
-SELECT ST_Area(ST_GeomFromWKT('POLYGON ((0 0, 10 0, 10 10, 0 10, 0 0))'));
+SELECT ST_Intersection(ST_GeomFromText('POLYGON ((1 1, 11 1, 1 11, 0 0))'), 
ST_GeomFromText('POLYGON ((0 0, 10 0, 0 10, 0 0))')) AS val
 ```
 
-## ST_Centroid
+-----
+
+## ST\_Intersection\_Aggr
 
 ### Description
 
-Returns the centroid of geom.
+An aggregate function that returns the geometric intersection of all 
geometries in a set.
 
 ### Format
 
-`ST_Centroid (A: Geometry)`
+`ST_Intersection_Aggr (geom: Geometry)`
 
 ### Arguments
 
-  * **geom**: Input geometry.
+  * **geom**: A column of geometries to be aggregated.
 
 ### SQL Example
 
 ```sql
-SELECT ST_AsText(ST_Centroid(ST_GeomFromWKT('POLYGON ((0 0, 10 0, 10 10, 0 10, 
0 0))')));
+-- Create a table with overlapping polygons and find their common intersection
+WITH shapes(geom) AS (
+    VALUES (ST_GeomFromWKT('POLYGON((0 0, 2 0, 2 2, 0 2, 0 0))')),
+           (ST_GeomFromWKT('POLYGON((1 1, 3 1, 3 3, 1 3, 1 1))'))
+)
+SELECT ST_AsText(ST_Intersection_Aggr(geom)) FROM shapes;
+-- Returns: POLYGON ((1 1, 1 2, 2 2, 2 1, 1 1))
 ```
 
-## ST_Dimension
+-----
+
+## ST\_Intersects
 
 ### Description
 
-Return the dimension of the geometry.
+Return true if geomA intersects geomB.
 
 ### Format
 
-`ST_Dimension (A: Geometry)`
+`ST_Intersects (A: Geometry, B: Geometry)`
 
 ### Arguments
 
-  * **geom**: Input geometry.
+  * **geomA**: Input geometry or geography.
+  * **geomB**: Input geometry or geography.
 
 ### SQL Example
 
 ```sql
-SELECT ST_Dimension(ST_GeomFromWKT('POLYGON ((0 0, 1 0, 0 1, 0 0))'));
+SELECT ST_Intersects(ST_Point(0.25 0.25), ST_GeomFromText('POLYGON ((0 0, 1 0, 
0 1, 0 0))')) AS val
 ```
 
-## ST_GeomFromWKB
+-----
+
+## ST\_IsEmpty
 
 ### Description
 
-Construct a Geometry from WKB.
+Return true if the geometry is empty.
 
 ### Format
 
-`ST_GeomFromWKB (Wkb: Binary)`
+`ST_IsEmpty (A: Geometry)`
 
 ### Arguments
 
-  * **WKB**: binary: Well-known binary representation of the geometry.
+  * **geom**: Input geometry.
 
 ### SQL Example
 
 ```sql
--- Creates a POINT(1 2) geometry from its WKB representation
-SELECT 
ST_AsText(ST_GeomFromWKB(FROM_HEX('0101000000000000000000F03F0000000000000040')));
+SELECT ST_IsEmpty(ST_GeomFromWKT('POLYGON EMPTY'));
 ```
 
-## ST_GeomFromWKT
+-----
+
+## ST\_KNN
 
 ### Description
 
-Construct a Geometry from WKT. This function also has the alias 
**ST_GeomFromText**.
+Return true if geomA finds k nearest neighbors from geomB.
 
 ### Format
 
-`ST_GeomFromWKT (Wkt: String)`
+`ST_KNN (A: Geometry, B: Geometry, k: Integer, use_spheroid: Boolean)`
 
 ### Arguments
 
-  * **WKT**: string: Well-known text representation of the geometry.
+  * **geomA**: Query geometry or geography.
+  * **geomB**: Object geometry or geography.
+  * **k**: Number of nearest neighbors to find.
+  * **use\_spheroid**: Use spheroid distance calculation.
 
 ### SQL Example
 
 ```sql
-SELECT ST_AsText(ST_GeomFromWKT('POINT (30 10)'));
+SELECT * FROM table1 a JOIN table2 b ON ST_KNN(a.geom, b.geom, 5, false)
 ```
 
-## ST_IsEmpty
+-----
+
+## ST\_Length
 
 ### Description
 
-Return true if the geometry is empty.
+Returns the length of geom. This function only supports LineString, 
MultiLineString, and GeometryCollections containing linear geometries. Use 
ST\_Perimeter for polygons.
 
 ### Format
 
-`ST_IsEmpty (A: Geometry)`
+`ST_Length (A: Geometry)`
 
 ### Arguments
 
-  * **geom**: Input geometry.
+  * **geom**: geometry: Input geometry.
 
 ### SQL Example
 
 ```sql
-SELECT ST_IsEmpty(ST_GeomFromWKT('POLYGON EMPTY'));
+SELECT ST_Length(ST_GeomFromWKT('LINESTRING(0 0, 10 0)'));
 ```
 
-## ST_Length
+-----
+
+## ST\_M
 
 ### Description
 
-Returns the length of geom. This function only supports LineString, 
MultiLineString, and GeometryCollections containing linear geometries. Use 
ST_Perimeter for polygons.
+Return the M component of a point geometry or geography.
 
 ### Format
 
-`ST_Length (A: Geometry)`
+`ST_M(A: Point)`
 
 ### Arguments
 
-  * **geom**: geometry: Input geometry.
+  * **geom**: Input geometry or geography.
 
 ### SQL Example
 
 ```sql
-SELECT ST_Length(ST_GeomFromWKT('LINESTRING(0 0, 10 0)'));
+SELECT ST_M(ST_Point(1.0, 2.0))
 ```
 
-## ST_Perimeter
+-----
 
-### Description
+## ST\_M
 
-This function calculates the 2D perimeter of a given geometry. It supports 
Polygon, MultiPolygon, and GeometryCollection geometries (as long as the 
GeometryCollection contains polygonal geometries). For other types, it returns 
0. To measure lines, use ST_Length.
+### Description
 
-To get the perimeter in meters, set **use_spheroid** to true. This calculates 
the geodesic perimeter using the WGS84 spheroid. When using use_spheroid, the 
**lenient** parameter defaults to true, assuming the geometry uses EPSG:4326. 
To throw an exception instead, set lenient to false.
+Returns the M (measure) coordinate of a `Point` geometry. If the geometry does 
not have an M value, it returns `NULL`.

Review Comment:
   There are two separate ST_M function definitions (lines 813-831 and 835-853) 
with slightly different descriptions. The first one is more basic while the 
second provides more detail about NULL handling. These should be consolidated 
into a single, comprehensive definition.



##########
docs/reference/sql.md:
##########
@@ -840,40 +917,43 @@ Returns the maximum **X-coordinate** of a geometry's 
bounding box.
 ### SQL Example
 
 ```sql
-SELECT ST_XMax(ST_GeomFromWKT('LINESTRING(1 5, 10 15)'));
--- Returns: 10
+SELECT ST_MMax(ST_GeomFromWKT('LINESTRING ZM (1 2 3 4, 5 6 7 8)'));
+-- Returns: 8
 ```
 
-## ST_YMin
+-----
+
+## ST\_MMax
 
 ### Description
 
-Returns the minimum **Y-coordinate** of a geometry's bounding box.
+Returns the maximum M (measure) value from a geometry's bounding box.

Review Comment:
   There are two separate ST_MMax function definitions with identical content 
(lines 903-922 and 926-944). This duplication should be removed to avoid 
confusion.



##########
docs/reference/sql.md:
##########
@@ -882,231 +962,250 @@ Returns the maximum **Y-coordinate** of a geometry's 
bounding box.
 ### SQL Example
 
 ```sql
-SELECT ST_YMax(ST_GeomFromWKT('LINESTRING(1 5, 10 15)'));
--- Returns: 15
+SELECT ST_MMin(ST_GeomFromWKT('LINESTRING ZM (1 2 3 4, 5 6 7 8)'));
+-- Returns: 4
 ```
 
-## ST_ZMin
+-----
+
+## ST\_MMin
 
 ### Description
 
-Returns the minimum **Z-coordinate** of a geometry's bounding box.
+Returns the minimum M (measure) value from a geometry's bounding box.

Review Comment:
   There are two separate ST_MMin function definitions with identical content 
(lines 948-966 and 971-989). This duplication should be removed to avoid 
confusion.



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