st_numgeometries
Preview
This feature is in Public Preview. You can confirm preview enrollment on the Previews page. See Manage Databricks previews.
Returns the number of geometries in the input geometry.
For the corresponding Databricks SQL function, see st_numgeometries function.
Syntax
Python
from pyspark.databricks.sql import functions as dbf
dbf.st_numgeometries(col=<col>)
Parameters
Parameter | Type | Description |
|---|---|---|
|
| A Geometry value. |
Examples
Python
from pyspark.databricks.sql import functions as dbf
df = spark.createDataFrame([('MULTIPOINT((1 2),EMPTY,EMPTY,(3 4))',)], ['wkt'])
df.select(dbf.st_numgeometries(dbf.st_geomfromtext('wkt')).alias('result')).collect()
Output
[Row(result=4)]