st_srid
Preview
This feature is in Public Preview. You can confirm preview enrollment on the Previews page. See Manage Databricks previews.
Returns the SRID of the input geospatial value.
For the corresponding Databricks SQL function, see st_srid function.
Syntax
Python
from pyspark.databricks.sql import functions as dbf
dbf.st_srid(col=<col>)
Parameters
Examples
Python
from pyspark.databricks.sql import functions as dbf
df = spark.createDataFrame([('POINT(10 34)',)], ['wkt'])
df.select(dbf.st_srid(dbf.st_geogfromtext('wkt')).alias('result')).collect()
Output
[Row(result=4326)]
Python
from pyspark.databricks.sql import functions as dbf
df = spark.createDataFrame([('LINESTRING(1 2,3 4)', '3857',)], ['wkt', 'srid'])
df.select(dbf.st_srid(dbf.st_geomfromtext('wkt', 'srid')).alias('result')).collect()
Output
[Row(result=3857)]