ST_Disjoint

Disjoint

ST_Disjoint takes two geometry columns and returns a boolean column. The function returns True if the first and second geometry are disjoint; otherwise, it returns False. Two geometries are disjoint if they are not overlapping, touching, or intersecting each other.

If the two geometry columns are in different spatial references, the function will automatically transform the second geometry into the spatial reference of the first.

FunctionSyntax
Pythondisjoint(geometry1, geometry2)
SQLST_Disjoint(geometry1, geometry2)
Scaladisjoint(geometry1, geometry2)

For more details, go to the GeoAnalytics Engine API reference for disjoint.

This function implements the OpenGIS Simple Features Implementation Specification for SQL 1.2.1.

Examples

PythonPythonSQLScala
Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
from geoanalytics.sql import functions as ST, Linestring, Polygon

data = [
    (Polygon([[[0,0],[10,10],[20,0]]]), Linestring([[[5,2],[20,20]]])),
    (Polygon([[[0,0],[10,10],[20,0]]]), Linestring([[[20,20],[30,20]]]))
]

df = spark.createDataFrame(data, ["polygon", "linestring"])

df.select(ST.disjoint("polygon", "linestring").alias("disjoint")).show()
Result
Use dark colors for code blocksCopy
1
2
3
4
5
6
+--------+
|disjoint|
+--------+
|   false|
|    true|
+--------+

Version table

ReleaseNotes

1.0.0

Python and SQL functions introduced

1.5.0

Scala function introduced

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.