PostGIS

ST_Force2D

Prev

7.5. Geometry Editors

Next

Name

ST_Force2D — Force the geometries into a "2-dimensional mode".

Synopsis

geometry +`*`+ST_Force2D*(`geometry `geomA`)`;

Description

Forces the geometries into a "2-dimensional mode" so that all output representations will only have the X and Y coordinates. This is useful for force OGC-compliant output (since OGC only specifies 2-D geometries).

Enhanced: 2.0.0 support for Polyhedral surfaces was introduced.

Changed: 2.1.0. Up to 2.0.x this was called ST_Force_2D.

check This method supports Circular Strings and Curves.

check This function supports Polyhedral surfaces.

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

Examples

SELECT ST_AsEWKT(ST_Force2D(ST_GeomFromEWKT('CIRCULARSTRING(1 1 2, 2 3 2, 4 5 2, 6 7 2, 5 6 2)')));
        st_asewkt
-------------------------------------
CIRCULARSTRING(1 1,2 3,4 5,6 7,5 6)

SELECT  ST_AsEWKT(ST_Force2D('POLYGON((0 0 2,0 5 2,5 0 2,0 0 2),(1 1 2,3 1 2,1 3 2,1 1 2))'));

                  st_asewkt
----------------------------------------------
 POLYGON((0 0,0 5,5 0,0 0),(1 1,3 1,1 3,1 1))

See Also

Prev

Up

Next

ST_FlipCoordinates

Home

ST_Force3D