Skip to main content

st_multi

Preview

This feature is in Public Preview.

Returns the input Geography or Geometry value as an equivalent multi geospatial value, keeping the original SRID.

For the corresponding Databricks SQL function, see st_multi function.

Syntax

Python
from pyspark.databricks.sql import functions as dbf

dbf.st_multi(col=<col>)

Parameters

Parameter

Type

Description

col

pyspark.sql.Column or str

A Geography or Geometry value.

Notes

Multi geospatial values and geometry collections are returned as is, with the same SRID.

Examples

Python
from pyspark.databricks.sql import functions as dbf
df = spark.createDataFrame([('POINT M (1 2 4)',)], ['wkt'])
df.select(dbf.st_asewkt(dbf.st_multi(dbf.st_geomfromtext('wkt', 4326))).alias('result')).collect()
Output
[Row(result='SRID=4326;MULTIPOINT M ((1 2 4))')]
Python
from pyspark.databricks.sql import functions as dbf
df = spark.createDataFrame([('MULTIPOINT ZM ((1 2 3 4))',)], ['wkt'])
df.select(dbf.st_asewkt(dbf.st_multi(dbf.st_geogfromtext('wkt'))).alias('result')).collect()
Output
[Row(result='SRID=4326;MULTIPOINT ZM ((1 2 3 4))')]