snowflake.snowpark.functions.st_hausdorffdistance¶

snowflake.snowpark.functions.st_hausdorffdistance(geography_expression_1: Union[snowflake.snowpark.column.Column, str], geography_expression_2: Union[snowflake.snowpark.column.Column, str]) → Column[source]¶

Returns the Hausdorff distance between two GEOGRAPHY objects.

Parameters:
  • geography_expression_1 (ColumnOrName) – A column containing GEOGRAPHY objects or a geography expression.

  • geography_expression_2 (ColumnOrName) – A column containing GEOGRAPHY objects or a geography expression.

Returns:

A column containing the Hausdorff distance between the two geography objects.

Return type:

Column

Examples::
>>> from snowflake.snowpark.functions import to_geography
>>> df = session.create_dataframe([
...     ("POINT(0 0)", "POINT(0 1)"),
...     ("POLYGON((-1 0, 0 1, 1 0, 0 -1, -1 0))", "POLYGON((-1 0, 0 1, 2 0, 0 -1, -1 0))")
... ], schema=["geog1", "geog2"])
>>> df.select(st_hausdorffdistance(to_geography(df["geog1"]), to_geography(df["geog2"]))).collect()
[Row(ST_HAUSDORFFDISTANCE(TO_GEOGRAPHY("GEOG1"), TO_GEOGRAPHY("GEOG2"))=1.0), Row(ST_HAUSDORFFDISTANCE(TO_GEOGRAPHY("GEOG1"), TO_GEOGRAPHY("GEOG2"))=1.0)]
Copy