st_xmin
Preview
This feature is in Public Preview.
Returns the minimum X coordinate of the input geometry, or None if the input geometry is empty.
For the corresponding Databricks SQL function, see st_xmin function.
Syntax
Python
from pyspark.databricks.sql import functions as dbf
dbf.st_xmin(col=<col>)
Parameters
Parameter | Type | Description |
|---|---|---|
|
| A Geometry value. |
Examples
Python
from pyspark.databricks.sql import functions as dbf
df = spark.createDataFrame([('LINESTRING Z (1 2 3,4 5 6,7 8 9)',)], ['wkt'])
df.select(dbf.st_xmin(dbf.st_geomfromtext('wkt')).alias('result')).collect()
Output
[Row(result=1.0)]
Python
from pyspark.databricks.sql import functions as dbf
df = spark.createDataFrame([('POLYGON Z ((2 0 1,1 2 0,-1 -1 2,0 -1 1, 2 0 1))',)], ['wkt'])
df.select(dbf.st_xmin(dbf.st_geomfromtext('wkt')).alias('result')).collect()
Output
[Row(result=-1.0)]