適用於:
Databricks SQL
Databricks Runtime 17.1 和更新版本
Important
這項功能目前處於 公開預覽版。
備註
這項功能不適用於 Databricks SQL Classic 倉儲。 若要深入瞭解 Databricks SQL 倉儲,請參閱 SQL 倉儲類型。
交換輸入 GEOMETRY 值的 X 和 Y 座標。
Syntax
st_flipcoordinates ( geoExpr )
Arguments
-
geoExpr:一個GEOMETRY值。
Returns
型別為 GEOMETRY 的值,其 X 和 Y 座標已交換。
輸出 GEOMETRY 值的SRID值等於輸入值的SRID值。
如果輸入為 NULL,則函式會傳NULL回 。
Examples
-- Swaps X and Y coordinates of a linestring.
> SELECT st_astext(st_flipcoordinates(st_geomfromtext('LINESTRING(1 2,3 4,5 6,7 8)')));
LINESTRING(2 1,4 3,6 5,8 7)
-- Swaps X and Y coordinates of a point.
> SELECT st_astext(st_flipcoordinates(st_geomfromtext('POINT(10 20)')));
POINT(20 10)