ST_Boundary

ST_Boundary
Input line and polygons (left) and the resulting boundaries (right).

ST_Boundary takes a geometry column and returns a geometry column. The output column contains the topological boundary of the given geometry. The function will return a linestring if the input is a polygon and a multipoint if the input is a linestring. Point and multipoint inputs are not supported.

FunctionSyntax
Pythonboundary(geometry)
SQLST_Boundary(geometry)
Scalaboundary(geometry)

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

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

Examples

PythonPythonSQLScala
Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
from geoanalytics_fabric.sql import functions as ST

data = [
    ("POINT (10, 30)",),
    ("MULTIPOINT (0 0, 10 10, 20 20)", ),
    ("LINESTRING (0 0, 10 10, 20 20)", ),
    ("POLYGON ((0 0, 5 5, 10 0, 20 10))", )
]

df = spark.createDataFrame(data, ["wkt"])\
          .select(ST.geom_from_text("wkt").alias("geometry"))

df.select(ST.boundary("geometry").alias("boundary")).show(truncate=False)
Result
Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
+----------------------------------------------+
|boundary                                      |
+----------------------------------------------+
|NULL                                          |
|NULL                                          |
|{"points":[[0,0],[20,20]]}                    |
|{"paths":[[[0,0],[20,10],[10,0],[5,5],[0,0]]]}|
+----------------------------------------------+

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.