Notiz
Zougrëff op dës Säit erfuerdert Autorisatioun. Dir kënnt probéieren, Iech unzemellen oder Verzeechnesser ze änneren.
Zougrëff op dës Säit erfuerdert Autorisatioun. Dir kënnt probéieren, Verzeechnesser ze änneren.
Important
This feature is in Public Preview.
Returns the perimeter of the input geography or geometry.
For the corresponding Databricks SQL function, see st_perimeter function.
Syntax
from pyspark.databricks.sql import functions as dbf
dbf.st_perimeter(col=<col>)
Parameters
| Parameter | Type | Description |
|---|---|---|
col |
pyspark.sql.Column or str |
A Geography or Geometry value. |
Notes
If the input is a geometry, Cartesian length is returned (in the unit of the input coordinates). If the input is a geography, length on the WGS84 spheroid is returned (expressed in meters).
Examples
from pyspark.databricks.sql import functions as dbf
from pyspark.sql.functions.builtin import round
df = spark.createDataFrame([('POLYGON((0 0,50 0,50 50,0 50,0 0),(20 20,25 30,30 20,20 20))',)], ['wkt'])
df.select(round(dbf.st_perimeter(dbf.st_geomfromtext('wkt')), 2).alias('result')).collect()
[Row(result=232.36)]