Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Important
This feature is in Public Preview.
Returns the number of geometries in the input geometry.
For the corresponding Databricks SQL function, see st_numgeometries function.
Syntax
from pyspark.databricks.sql import functions as dbf
dbf.st_numgeometries(col=<col>)
Parameters
| Parameter | Type | Description |
|---|---|---|
col |
pyspark.sql.Column or str |
A Geometry value. |
Examples
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()
[Row(result=4)]