Note
Kailangan ng pahintulot para ma-access ang page na ito. Maaari mong subukang mag-sign in o magpalit ng mga direktoryo.
Ang pag-access sa pahinang ito ay nangangailangan ng pahintulot. Maaari mong subukang baguhin ang mga direktoryo.
Important
This feature is in Public Preview.
Parses the WKT description and returns the corresponding Geometry value.
For the corresponding Databricks SQL function, see st_geomfromtext function.
Syntax
from pyspark.databricks.sql import functions as dbf
dbf.st_geomfromtext(col1=<col1>, col2=<col2>)
Parameters
| Parameter | Type | Description |
|---|---|---|
col1 |
pyspark.sql.Column or str |
A string value in WKT format, representing a Geometry value. |
col2 |
pyspark.sql.Column or int, optional |
The optional SRID value of the geometry. Default is 0. |
Examples
from pyspark.databricks.sql import functions as dbf
df = spark.createDataFrame([('LINESTRING(5 6,7 -8)',)], ['wkt'])
df.select(dbf.st_astext(dbf.st_geomfromtext('wkt')).alias('result')).collect()
[Row(result='LINESTRING(5 6,7 -8)')]
from pyspark.databricks.sql import functions as dbf
df = spark.createDataFrame([('LINESTRING(5 6,7 -8)', 3857,)], ['wkt', 'srid'])
df.select(dbf.st_astext(dbf.st_geomfromtext('wkt', 'srid')).alias('result')).collect()
[Row(result='LINESTRING(5 6,7 -8)')]