ST_Split

ST_Split takes a linestring or polygon column and a linestring column and returns an array column. This function splits the geometry with the splitter linestring and returns the resulting parts as an array of geometries. If the input geometry is a linestring, the output will be an array of linestrings. If the input geometry type is a polygon, the output will be an array of polygons. If a linestring is split by an equal linestring, an empty linestring along with the input linestring and the splitter linestring are returned.

FunctionSyntax
Pythonsplit(geometry, splitter)
SQLST_Split(geometry, splitter)
Scalasplit(geometry, splitter)

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

Examples

PythonPythonSQLScala
1
2
3
4
5
6
7

from geoanalytics.sql import functions as ST, Linestring, Polygon

df = spark.createDataFrame([(Linestring([[[0, -30],[0, 30]]]), Polygon([[[-20, -20],[20, -20],[20, 20],[-20, 20]]]))],
                           ["linestring", "polygon"])

df.select(ST.split("polygon", "linestring").alias("split")).show(truncate=False)
Result
1
2
3
4
5
+------------------------------------------------------------------------------------------------------------------+
|split                                                                                                             |
+------------------------------------------------------------------------------------------------------------------+
|[{"rings":[[[-20,-20],[-20,20],[0,20],[0,-20],[-20,-20]]]}, {"rings":[[[0,-20],[0,20],[20,20],[20,-20],[0,-20]]]}]|
+------------------------------------------------------------------------------------------------------------------+

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.

You can no longer sign into this site. Go to your ArcGIS portal or the ArcGIS Location Platform dashboard to perform management tasks.

Your ArcGIS portal

Create, manage, and access API keys and OAuth 2.0 developer credentials, hosted layers, and data services.

Your ArcGIS Location Platform dashboard

Manage billing, monitor service usage, and access additional resources.

Learn more about these changes in the What's new in Esri Developers June 2024 blog post.

Close