Nome

ST_Reverse — Return the geometry with vertex order reversed.

Sinossi

geometry ST_Reverse(geometry g1);

Descrizione

Can be used on any geometry and reverses the order of the vertices.

Enhanced: 2.4.0 support for curves was introduced.

Questa funzione supporta il 3d e non distrugge gli z-index.

Questa funzione supporta le Polyhedral Surface.

Esempi

Code
WITH data(geom) AS (VALUES (
  ST_MakeLine(ST_Point(1, 2), ST_Point(1, 10))
))
SELECT geom AS input_line,
       ST_Reverse(geom) AS reversed_line
FROM data;
Output
input_line      |    reversed_line
----------------------+----------------------
 LINESTRING(1 2,1 10) | LINESTRING(1 10,1 2)
(1 row)
Figure
Geometry figure for visual-st-reverse-01