You are viewing documentation about an older version (1.8.0). View latest version

snowflake.snowpark.functions.st_xmax¶

snowflake.snowpark.functions.st_xmax(geography_or_geometry_expression: Union[snowflake.snowpark.column.Column, str]) → Column[source]¶

Returns the maximum X coordinate of the bounding box of a GEOGRAPHY or GEOMETRY object.

Parameters:

geography_or_geometry_expression (ColumnOrName) – A GEOGRAPHY or GEOMETRY object.

Returns:

The maximum X coordinate values.

Return type:

Column

Examples::
>>> from snowflake.snowpark.functions import col, to_geography
>>> df = session.create_dataframe([
...     ['POINT(-60 30)'],
...     ['POINT(180 0)'],
...     ['LINESTRING(-60 30, 60 30)']
... ], schema=["geom"])
>>> df.select(st_xmax(to_geography(df["geom"])).alias("xmax")).collect()
[Row(XMAX=-59.99999999999999), Row(XMAX=180.0), Row(XMAX=60.00000000000002)]
Copy