Nota
L-aċċess għal din il-paġna jeħtieġ l-awtorizzazzjoni. Tista’ tipprova tidħol jew tibdel id-direttorji.
L-aċċess għal din il-paġna jeħtieġ l-awtorizzazzjoni. Tista’ tipprova tibdel id-direttorji.
Important
This feature is in Public Preview. You can confirm preview enrollment on the Previews page. See Manage Azure Databricks previews.
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))')]