ST_BboxIntersects takes a geometry column and four numeric values and returns a boolean column. The four numeric values
represent the minimum and maximum x,y coordinates of an axis-aligned rectangle, also known as an envelope. The function
returns True
if the geometry intersects the defined envelope; otherwise, it returns False
. The x,y coordinates should be
specified in the same units as the input geometry column. For example, if the input geometry is in a spatial reference that
uses degrees, xmin
, ymin
, xmax
, and ymax
should all be in degrees.
Function | Syntax |
---|---|
Python | bbox |
SQL | ST |
Scala | bbox |
For more details, go to the GeoAnalytics for Microsoft Fabric API reference for bbox_intersects.
Examples
from geoanalytics_fabric.sql import functions as ST
data = [
("POINT (10 30)",),
("MULTIPOINT (0 0, 5 5, 0 5)", ),
("LINESTRING (15 15, 10 15, 12 2)", ),
("POLYGON ((20 30, 18 28, 22 35, 40 20))", )
]
df = spark.createDataFrame(data, ["wkt"])\
.select(ST.geom_from_text("wkt").alias("geometry"))
df.select(ST.bbox_intersects("geometry", xmin=0.0, ymin=0.0, xmax=15.0, ymax=15.0).alias("bbox_intersects")) \
.show()
+---------------+
|bbox_intersects|
+---------------+
| false|
| true|
| true|
| false|
+---------------+
Version table
Release | Notes |
---|---|
1.0.0-beta | Python, SQL, and Scala functions introduced |