snowflake.snowpark.functions.st_setsrid¶

snowflake.snowpark.functions.st_setsrid(geometry_expression: Union[snowflake.snowpark.column.Column, str], srid: Union[snowflake.snowpark.column.Column, str]) → Column[source]¶

Sets the spatial reference identifier (SRID) for a geometry object.

Parameters:
  • geometry_expression (ColumnOrName) – A geometry object or column containing geometry data

  • srid (ColumnOrName) – The spatial reference identifier to set for the geometry

Returns:

A new geometry object with the specified SRID

Return type:

Column

Examples::
>>> from snowflake.snowpark.functions import to_geometry, lit
>>> df = session.create_dataframe([["POINT(13 51)"]], schema=["geometry_wkt"])
>>> df.select(st_setsrid(to_geometry(df["geometry_wkt"]), lit(4326)).alias("result")).collect()
[Row(RESULT='{\n  "coordinates": [\n    1.300000000000000e+01,\n    5.100000000000000e+01\n  ],\n  "type": "Point"\n}')]
Copy