snowflake.snowpark.functions.st_xmax

snowflake.snowpark.functions.st_xmax(geography_or_geometry_expression: Union[snowflake.snowpark.column.Column, str]) Column[source] (https://github.com/snowflakedb/snowpark-python/blob/v1.41.0/src/snowflake/snowpark/_functions/scalar_functions.py#L3491-L3515)

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
语言: 中文