snowflake.snowpark.functions.st_covers¶
- snowflake.snowpark.functions.st_covers(geography_or_geometry_expression_1: Union[snowflake.snowpark.column.Column, str], geography_or_geometry_expression_2: Union[snowflake.snowpark.column.Column, str]) Column[source]¶
Returns TRUE if the first geography completely covers the second geography.
- Parameters:
geography_or_geometry_expression_1 (ColumnOrName) – A column containing the first geography object
geography_or_geometry_expression_2 (ColumnOrName) – A column containing the second geography object that may be covered by the first
- Returns:
A boolean column indicating whether the first geography covers the second
- Return type:
- Examples::
>>> from snowflake.snowpark.functions import col, to_geography >>> df = session.create_dataframe([ ... ('POLYGON((0 0, 3 0, 3 3, 0 3, 0 0))', 'POLYGON((1 1, 2 1, 2 2, 1 2, 1 1))'), ... ('POLYGON((-2 0, 0 2, 2 0, -2 0))', 'POLYGON((-1 0, 0 1, 1 0, -1 0))') ... ], schema=["g1", "g2"]) >>> df.select(st_covers(to_geography(col("g1")), to_geography(col("g2"))).alias("result")).collect() [Row(RESULT=True), Row(RESULT=False)]