Nóta
Aðgangur að þessari síðu krefst heimildar. Þú getur prófað aðskrá þig inn eða breyta skráasöfnum.
Aðgangur að þessari síðu krefst heimildar. Þú getur prófað að breyta skráasöfnum.
Important
This feature is in Public Preview.
Returns the buffer of the input geometry using the specified radius.
For the corresponding Databricks SQL function, see st_buffer function.
Syntax
from pyspark.databricks.sql import functions as dbf
dbf.st_buffer(col1=<col1>, col2=<col2>)
Parameters
| Parameter | Type | Description |
|---|---|---|
col1 |
pyspark.sql.Column or str |
A Geometry value. |
col2 |
pyspark.sql.Column or float |
Radius of the buffer. The unit of the radius are those of the coordinate reference system of the geometry. |
Examples
from pyspark.databricks.sql import functions as dbf
df = spark.createDataFrame([('POINT(0 0)',)], ['wkt'])
df.select(dbf.st_asewkt(dbf.st_envelope(dbf.st_buffer(dbf.st_geomfromtext('wkt', 4326), 1.0))).alias('result')).collect()
[Row(result='SRID=4326;POLYGON((-1 -1,-1 1,1 1,1 -1,-1 -1))')]