名前
ST_Reverse — 頂点の順序を逆にしたジオメトリを返します。
概要
geometry ST_Reverse(
geometry g1)
;
説明
どのジオメトリでも使用可能です。頂点の順序を逆にします。
Enhanced: 2.4.0 曲線対応が導入されました。
This function supports 3d and will not drop the z-index.
This function supports Polyhedral surfaces.
例
SELECT ST_AsText(the_geom) as line, ST_AsText(ST_Reverse(the_geom)) As reverseline
FROM
(SELECT ST_MakeLine(ST_MakePoint(1,2),
ST_MakePoint(1,10)) As the_geom) as foo;
-- 結果
line | reverseline
---------------------+----------------------
LINESTRING(1 2,1 10) | LINESTRING(1 10,1 2)