snowflake.snowpark.functions.st_area¶
- snowflake.snowpark.functions.st_area(geography_or_geometry_expression: Union[snowflake.snowpark.column.Column, str]) Column[source]¶
Returns the area of a GEOGRAPHY or GEOMETRY object.
- Parameters:
geography_or_geometry_expression (ColumnOrName) – A GEOGRAPHY or GEOMETRY object
- Returns:
The area of the input geography or geometry object
- Return type:
- Examples::
>>> from snowflake.snowpark.functions import to_geometry >>> df = session.create_dataframe([ ... ['POLYGON((0 0, 0 1, 1 1, 1 0, 0 0))'], ... ['POINT(1 1)'], ... ['LINESTRING(0 0, 1 1)'] ... ], schema=["geom"]) >>> df.select(st_area(to_geometry(df["geom"])).alias("area")).collect() [Row(AREA=1.0), Row(AREA=0.0), Row(AREA=0.0)]