snowflake.snowpark.functions.st_interpolate¶

snowflake.snowpark.functions.st_interpolate(geography_expression: Union[snowflake.snowpark.column.Column, str], tolerance: Union[snowflake.snowpark.column.Column, str] = None) → Column[source]¶

Returns a geography object with additional points interpolated along the edges of the input geography.

Parameters:
  • geography_expression (ColumnOrName) – A geography data

  • tolerance (ColumnOrName, optional) – The maximum distance between interpolated points in meters

Returns:

A geography object with interpolated points along its edges

Return type:

Column

Examples::
>>> from snowflake.snowpark.functions import to_geography
>>> df = session.create_dataframe([
...     ['POLYGON((2.365837 48.862456,-76.992874 39.009046,-16.091194 18.013997,2.365837 48.862456))']
... ], schema=["geog_wkt"])
>>> df.select(st_interpolate(to_geography(df["geog_wkt"])).alias("interpolated")).collect()
[Row(INTERPOLATED='{\n  "coordinates": [\n    [\n      [\n        2.365837000000000e+00,\n        4.886245600000001e+01\n      ...     ],\n      [\n        2.365837000000000e+00,\n        4.886245600000001e+01\n      ]\n    ]\n  ],\n  "type": "Polygon"\n}')]
Copy
>>> df.select(st_interpolate(to_geography(df["geog_wkt"]), lit(1000)).alias("interpolated_with_tolerance")).collect()
[Row(INTERPOLATED_WITH_TOLERANCE='{\n  "coordinates": [\n    [\n      [\n        2.365837000000000e+00,\n        4.886245600000...     ],\n      [\n        2.365837000000000e+00,\n        4.886245600000001e+01\n      ]\n    ]\n  ],\n  "type": "Polygon"\n}')]
Copy