Name

ST_SwapOrdinates — 返回交换了给定纵坐标的给定几何图形的版本。

Synopsis

geometry ST_SwapOrdinates(geometry geom, cstring ords);

描述

返回交换了给定坐标的给定几何图形的版本。

这个 ords 参数是命名要交换的坐标的两个字符的字符串。有效名称为:x、y、z和m。

可用性: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).

示例

-- Scale M value by 2
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