ST_ShiftLongitude — 在-180..180和0..360之间移动几何体的经度坐标。
geometry ST_ShiftLongitude(
geometry geom)
;
读取几何体中的每个点/顶点,并将其经度坐标从-180..0移动到180..360,如果在这些范围之间,则反之亦然。该函数是对称的,因此结果是-180..180数据的0..360表示和0..360数据的-180..180表示。
![]() | |
这仅对具有经度/纬度坐标的数据有用;例如SRID 4326(WGS 84地理位置) |
![]() | |
1.3.4之前的错误阻止了这一点的多点工作。1.3.4+也适用于多点。 |
This function supports 3d and will not drop the z-index.
增强:引入了对多面体曲面和三角网的2.0.0支持。
注意:此函数在2.2.0中从“ST_SHIFT_LONGATION”重命名
This function supports Polyhedral surfaces.
This function supports Triangles and Triangulated Irregular Network Surfaces (TIN).
--single point forward transformation SELECT ST_AsText(ST_ShiftLongitude('SRID=4326;POINT(270 0)'::geometry)) st_astext ---------- POINT(-90 0) --single point reverse transformation SELECT ST_AsText(ST_ShiftLongitude('SRID=4326;POINT(-90 0)'::geometry)) st_astext ---------- POINT(270 0) --for linestrings the functions affects only to the sufficient coordinates SELECT ST_AsText(ST_ShiftLongitude('SRID=4326;LINESTRING(174 12, 182 13)'::geometry)) st_astext ---------- LINESTRING(174 12,-178 13)