ST_Reverse

更新时间:
复制 MD 格式

Reverses the order of the vertices of a geometry.

Syntax

geometry ST_Reverse(geometry g1);

Parameters

ParameterDescription
g1The input geometry.

Description

  • Reverses the vertex order of all geometry types.

  • Supports polyhedral surfaces.

  • Supports 3D geometry and preserves Z coordinates.

Examples

SELECT ST_AsText(ST_Reverse(ST_GeomFromText('LINESTRING(2 1,1 1)')));
      st_astext
---------------------
 LINESTRING(1 1,2 1)
(1 row)