名前

ST_SwapOrdinates — 与えられたジオメトリにおいて与えられた座標の値を入れ替えたジオメトリを返します。

概要

geometry ST_SwapOrdinates(geometry geom, cstring ords);

説明

与えられたジオメトリにおいて与えられた座標の値を入れ替えたジオメトリを返します。

ords引数は2文字の文字列で、入れ替える座標名を示します。座標名はx, y, z, mが有効です。

Availability: 2.2.0

This method supports Circular Strings and Curves

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

This function supports M coordinates.

This function supports Polyhedral surfaces.

This function supports Triangles and Triangulated Irregular Network Surfaces (TIN).

-- M値を2倍にする
-- (訳注: M値の拡大縮小はST_Scaleだけではできません)
SELECT ST_AsText(
  ST_SwapOrdinates(
    ST_Scale(
      ST_SwapOrdinates(g,'xm'),
      2, 1
    ),
  'xm')
) FROM ( SELECT 'POINT ZM (0 0 0 2)'::geometry g ) foo;
     st_astext
--------------------
 POINT ZM (0 0 0 4)
                 

関連情報

ST_FlipCoordinates