Pastaba.
Prieigai prie šio puslapio reikalingas įgaliojimas. Galite bandyti prisijungti arba pakeisti katalogus.
Prieigai prie šio puslapio reikalingas įgaliojimas. Galite bandyti pakeisti katalogus.
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))')]