名前

ST_ShiftLongitude — ジオメトリの座標値を-180度から180度の範囲と0度から360度の範囲に揃えます。

概要

geometry ST_ShiftLongitude(geometry geomA);

説明

ジオメトリの全ての地物の全てのポイント/頂点を読み、経度値が0より小さい場合には360を足します。結果は、180度を中心にした地図に描画される、経度が0-360の区間にあるデータです。

[注記]

これは4326 (WGS84経度緯度)のような経度緯度でのみ使えます。

1.3.4より前ではMULTIPOINTでは動作しないバグがありました。1.3.4以上ではMULTIPOINTでも動作します。

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

Enhanced: 2.0.0 多面体サーフェス対応とTIN対応が導入されました。

ご注意: この関数は2.0.0で"ST_Shift_Longitude"から名称変更しました。

This function supports Polyhedral surfaces.

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

-- 3次元ポイント
SELECT ST_AsEWKT(ST_ShiftLongitude(ST_GeomFromEWKT('SRID=4326;POINT(-118.58 38.38 10)'))) As geomA,
        ST_AsEWKT(ST_ShiftLongitude(ST_GeomFromEWKT('SRID=4326;POINT(241.42 38.38 10)'))) As geomb
geomA                                                          geomB
----------                                                  -----------
SRID=4326;POINT(241.42 38.38 10) SRID=4326;POINT(-118.58 38.38 10)

-- 普通のラインストリング
SELECT ST_AsText(ST_ShiftLongitude(ST_GeomFromText('LINESTRING(-118.58 38.38, -118.20 38.45)')))

st_astext
----------
LINESTRING(241.42 38.38,241.8 38.45)
                

関連情報

ST_WrapX