Name

ST_Reverse — 返回顶点顺序颠倒的几何体。

Synopsis

geometry ST_Reverse(geometry g1);

描述

可用于任何几何体,并颠倒顶点的顺序。

增强:引入了对曲线的2.4.0支持。

This function supports 3d and will not drop the z-index.

This function supports Polyhedral surfaces.

示例

SELECT ST_AsText(geom) as line, ST_AsText(ST_Reverse(geom)) As reverseline
FROM
(SELECT ST_MakeLine(ST_Point(1,2),
                ST_Point(1,10)) As geom) as foo;
--result
                line         |     reverseline
---------------------+----------------------
LINESTRING(1 2,1 10) | LINESTRING(1 10,1 2)