snowflake.snowpark.functions.st_aswkt

snowflake.snowpark.functions.st_aswkt(geography_or_geometry_expression: Union[snowflake.snowpark.column.Column, str]) Column[source] (https://github.com/snowflakedb/snowpark-python/blob/v1.40.0/src/snowflake/snowpark/_functions/scalar_functions.py#L2197-L2220)

Returns the WKT (well-known text) representation of a GEOGRAPHY or GEOMETRY object.

Parameters:

geography_or_geometry_expression (ColumnOrName) – A GEOGRAPHY or GEOMETRY objects to convert to WKT format.

Returns:

The WKT representation of the input geography or geometry objects.

Return type:

Column

Examples::
>>> from snowflake.snowpark.functions import col, to_geography
>>> df = session.create_dataframe([
...     'POINT(-122.35 37.55)',
...     'LINESTRING(-124.20 42.00, -120.01 41.99)'
... ], schema=["g"])
>>> df.select(st_aswkt(to_geography(col("g"))).alias("RESULT")).collect()
[Row(RESULT='POINT(-122.35 37.55)'), Row(RESULT='LINESTRING(-124.2 42,-120.01 41.99)')]
Copy
Language: English