snowflake.snowpark.functions.st_startpoint¶
- snowflake.snowpark.functions.st_startpoint(geography_or_geometry_expression: Union[snowflake.snowpark.column.Column, str]) Column[source]¶
Returns the first point of a LINESTRING geography or geometry object as a POINT object.
- Parameters:
geography_or_geometry_expression (ColumnOrName) – The LINESTRING geography or geometry object
- Returns:
The POINT objects representing the start point of the input LINESTRING
- Return type:
- Examples::
>>> from snowflake.snowpark.functions import to_geography, to_geometry >>> df_geography = session.create_dataframe([["LINESTRING(1 1, 2 2, 3 3, 4 4)"]], schema=["linestring"]) >>> df_geography.select(st_startpoint(to_geography(df_geography["linestring"])).alias("startpoint")).collect() [Row(STARTPOINT='{\n "coordinates": [\n 1.000000000000000e+00,\n 1.000000000000000e+00\n ],\n "type": "Point"\n}')] >>> df_geometry = session.create_dataframe([["LINESTRING(1 1, 2 2, 3 3, 4 4)"]], schema=["linestring"]) >>> df_geometry.select(st_startpoint(to_geometry(df_geometry["linestring"])).alias("startpoint")).collect() [Row(STARTPOINT='{\n "coordinates": [\n 1.000000000000000e+00,\n 1.000000000000000e+00\n ],\n "type": "Point"\n}')]