snowflake.snowpark.functions.st_coveredby¶
- snowflake.snowpark.functions.st_coveredby(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 geography_expression_1 is completely covered by geography_expression_2.
- Parameters:
geography_or_geometry_expression_1 (ColumnOrName) – A column or name representing the first geography expression
geography_or_geometry_expression_2 (ColumnOrName) – A column or name representing the second geography expression
- Returns:
A boolean column indicating whether the first geography is covered by 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((1 1, 2 1, 2 2, 1 2, 1 1))', 'POLYGON((0 0, 3 0, 3 3, 0 3, 0 0))'] ... ], schema=["g1", "g2"]) >>> df.select(st_coveredby(to_geography(col("g1")), to_geography(col("g2"))).alias("covered_by")).collect() [Row(COVERED_BY=False), Row(COVERED_BY=True)]