snowflake.snowpark.functions.st_asewkt

snowflake.snowpark.functions.st_asewkt(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#L1713-L1737)

Returns the Extended Well-Known Text (EWKT) representation of a GEOGRAPHY or GEOMETRY object.

Parameters:

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

Returns:

The EWKT representation as a string

Return type:

Column

Examples::
>>> from snowflake.snowpark.functions import to_geography
>>> from snowflake.snowpark import Row
>>> df = session.create_dataframe([
...     ['POINT(-122.35 37.55)'],
...     ['LINESTRING(-124.20 42.00, -120.01 41.99)']
... ], schema=["g"])
>>> result = df.select(st_asewkt(to_geography(df["g"])).alias("result")).collect()
>>> assert result == [Row(RESULT='SRID=4326;POINT(-122.35 37.55)'), Row(RESULT='SRID=4326;LINESTRING(-124.2 42,-120.01 41.99)')]
Copy
语言: 中文