
ST_Equals takes two geometry columns and returns a boolean column. The function returns True
if the first geometry
and the second geometry are spatially equal; otherwise, it returns False
.
Function | Syntax |
---|---|
Python | equals(geometry1, geometry2) |
SQL | ST |
Scala | equals(geometry1, geometry2) |
For more details, go to the GeoAnalytics Engine API reference for equals.
This function implements the OpenGIS Simple Features Implementation Specification for SQL 1.2.1.
Examples
from geoanalytics.sql import functions as ST, Point
data = [
(Point(5,2), Point(5,2)),
(Point(5,2), Point(20,20))
]
df = spark.createDataFrame(data, ["point1", "point2"])
df.select(ST.equals("point1", "point2").alias("equals")).show()
+------+
|equals|
+------+
| true|
| false|
+------+
Version table
Release | Notes |
---|---|
1.0.0 | Python and SQL functions introduced |
1.5.0 | Scala function introduced |