ST_BboxIntersects

BboxIntersects

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.

FunctionSyntax
Pythonbbox_intersects(geometry, xmin, ymin, xmax, ymax)
SQLST_BboxIntersects(geometry, xmin, ymin, xmax, ymax)
ScalabboxIntersects(geometry, xmin, ymin, xmax, ymax)

For more details, go to the GeoAnalytics for Microsoft Fabric API reference for bbox_intersects.

Examples

PythonPythonSQLScala
Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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()
Result
Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
+---------------+
|bbox_intersects|
+---------------+
|          false|
|           true|
|           true|
|          false|
+---------------+

Version table

ReleaseNotes

1.0.0-beta

Python, SQL, and Scala functions introduced

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