Copilot commented on code in PR #3159:
URL: https://github.com/apache/sedona/pull/3159#discussion_r3644089376
##########
python/sedona/spark/sql/st_predicates.py:
##########
@@ -91,6 +91,29 @@ def ST_Equals(a: ColumnOrName, b: ColumnOrName) -> Column:
return _call_predicate_function("ST_Equals", (a, b))
+@validate_argument_types
+def ST_EqualsExact(
+ a: ColumnOrName,
+ b: ColumnOrName,
+ tolerance: Union[ColumnOrName, float, int],
+) -> Column:
+ """Check whether two geometries have the same structure and coordinate
ordering
+ within a tolerance.
+
+ The comparison uses x and y coordinates. Z and M coordinates are ignored.
+
+ :param a: One geometry column to check.
+ :type a: ColumnOrName
+ :param b: Other geometry column to check.
+ :type b: ColumnOrName
+ :param tolerance: Maximum distance allowed between corresponding
coordinates.
+ :type tolerance: ColumnOrName or float
Review Comment:
Docstring type hint for `tolerance` is out of sync with the function
signature: the signature accepts `int` but the `:type tolerance:` line only
mentions float. This can confuse users and doc generators.
##########
docs/api/sql/Predicates/ST_EqualsExact.md:
##########
@@ -0,0 +1,62 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ -->
+
+# ST_EqualsExact
+
+Introduction: Return true if A and B have the same structure and their
corresponding coordinates are equal within a tolerance.
+
+Unlike `ST_Equals`, this predicate requires geometry types, component order,
ring order, and vertex order to match. The tolerance is the maximum distance
allowed between each pair of corresponding coordinates. The comparison uses x
and y coordinates and ignores z and m coordinates.
Review Comment:
Minor grammar/capitalization in the SQL docs: use "Returns true" (consistent
with other docs) and capitalize Z/M to match the rest of the page.
--
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]