All Products
Search
Document Center

PolarDB:ST_FlipCoordinates

Last Updated:Mar 28, 2026

Flips the x-axis and y-axis of an input object.

Syntax

meshgeom  ST_FlipCoordinates(meshgeom  geom);
sfmesh    ST_FlipCoordinates(sfmesh  sfmeshObject);

Parameters

ParameterTypeDescription
geommeshgeomThe meshgeom object.
sfmeshObjectsfmeshThe sfmesh object.

Return values

Input typeReturn type
meshgeommeshgeom
sfmeshsfmesh

Examples

The following example flips the x-axis and y-axis of a meshgeom object and returns the result as text.

SELECT ST_AsText(ST_FlipCoOrdinates(ST_MeshFromText('{"version" : 1, "root" : 0, "meshgeoms" : ["MESHGEOM(PATCH(INDEXSURFACE Z (VERTEX(0 0 2,0 10 3,10 10 1,10 0 1),INDEX((0,1,2),(1,2,3)))))"], "primitives" : [{"meshgeom" : 0}], "nodes" : [{"primitive" : 0}]}')));

Expected output:

{"version" : 1, "root" : 0, "meshgeoms" : ["MESHGEOM(PATCH(INDEXSURFACE Z (VERTEX(0 0 2,10 0 3,10 10 1,0 10 1),INDEX((0,1,2),(1,2,3)))))"], "primitives" : [{"meshgeom" : 0}], "nodes" : [{"primitive" : 0}]}