ST_EnvIntersects

ST_EnvIntersects takes two geometry columns and returns a boolean column. The function returns True if the envelopes of two geometries intersect; otherwise, it returns False.

FunctionSyntax
Pythonenv_intersects(geometry1, geometry2)
SQLST_EnvIntersects(geometry1, geometry2)
ScalaenvIntersects(geometry1, geometry2)

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

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([[[19,5],[20,20]]])),
    (Polygon([[[0,0],[10,10],[20,0]]]), Linestring([[[30,40],[32,43]]])),
]

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

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

Version table

ReleaseNotes

1.0.0

Python and SQL functions introduced

1.2.0

Function behavior changed

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.