הערה
גישה לעמוד זה דורשת אישור. אתה יכול לנסות להיכנס או לשנות תיקיות.
גישה לעמוד זה דורשת אישור. אתה יכול לנסות לשנות מדריכים.
Important
This feature is in Public Preview.
Returns a new Geometry value whose SRID is the specified SRID value.
For the corresponding Databricks SQL function, see st_setsrid function.
Syntax
from pyspark.databricks.sql import functions as dbf
dbf.st_setsrid(col1=<col1>, col2=<col2>)
Parameters
| Parameter | Type | Description |
|---|---|---|
col1 |
pyspark.sql.Column or str |
A Geometry value. |
col2 |
pyspark.sql.Column or int |
The new SRID value of the geometry. |
Examples
from pyspark.databricks.sql import functions as dbf
df = spark.createDataFrame([('LINESTRING(5 6,7 -8)',)], ['wkt'])
df.select(dbf.st_srid(dbf.st_setsrid(dbf.st_geomfromtext('wkt'), 4326)).alias('result')).collect()
[Row(result=4326)]
from pyspark.databricks.sql import functions as dbf
df = spark.createDataFrame([('LINESTRING(5 6,7 -8)', 3857,)], ['wkt', 'srid'])
df.select(dbf.st_srid(dbf.st_setsrid(dbf.st_geomfromtext('wkt', 'srid'), 4326)).alias('result')).collect()
[Row(result=4326)]