snowflake.snowpark.functions.st_endpoint¶
- snowflake.snowpark.functions.st_endpoint(geography_or_geometry_expression: Union[snowflake.snowpark.column.Column, str]) Column[source]¶
Returns the last point of a LINESTRING or MULTILINESTRING geometry or geography object.
- Parameters:
geography_or_geometry_expression (ColumnOrName) – A column containing LINESTRING or MULTILINESTRING geometry or geography data
- Returns:
A column containing the endpoint as a POINT geometry or geography object
- Return type:
Examples
>>> from snowflake.snowpark.functions import to_geography >>> df = session.create_dataframe([['LINESTRING(1 1, 2 2, 3 3, 4 4)']], schema=["linestring"]) >>> df.select(st_endpoint(to_geography(df["linestring"])).alias("endpoint")).collect() [Row(ENDPOINT='{\n "coordinates": [\n 4.000000000000000e+00,\n 4.000000000000000e+00\n ],\n "type": "Point"\n}')]