

 2026 年 6 月 30 日之后，Amazon Redshift 不再支持使用 Python UDF。我们将分阶段开始执行。有关 Python 生命周期终止和迁移选项详情的更多信息，请参阅 2025 年 6 月 30 日发布的[博客文章](https://aws.amazon.com/blogs/big-data/amazon-redshift-python-user-defined-functions-will-reach-end-of-support-after-june-30-2026/)。

# ST\_Reverse
<a name="ST_Reverse-function"></a>

ST\_Reverse 可反转线性几何体和平面几何体的顶点顺序。对于点或多点几何体，将返回原始几何体的副本。对于几何体集合，ST\_Reverse 将反转集合中每个几何体的顶点顺序。

返回的几何体的维度与输入几何体的维度相同。

## 语法
<a name="ST_Reverse-function-syntax"></a>

```
ST_Reverse(geom)
```

## 参数
<a name="ST_Reverse-function-arguments"></a>

 *geom*   
一个 `GEOMETRY` 数据类型的值，或一个计算结果为 `GEOMETRY` 类型的表达式。

## 返回类型
<a name="ST_Reverse-function-return"></a>

`GEOMETRY` 

返回的几何体的空间参考系统标识符 (SRID) 与输入几何体的相同。

如果 *geom* 为 null，则返回 null。

## 示例
<a name="ST_Reverse-function-examples"></a>

以下 SQL 反转线串中点的顺序。

```
SELECT ST_AsEWKT(ST_Reverse(ST_GeomFromText('LINESTRING(1 0,2 0,3 0,4 0)', 4326)));
```

```
    st_asewkt
------------------------------------
  SRID=4326;LINESTRING(4 0,3 0,2 0,1 0)
```