Name

ST_Force_2D — Forces the incoming geometry to be 2D, so it will only have X,Y coordinates.

Synopsis

geometry ST_Force_2D(bytea Geometry);

Alias

Force_2D

Description

Forces the incoming geometry to be 2D, so it will only have X,Y coordinates.

Coordinate Dimensions
2D3DM

-

-

Spatial Standards Support
OGC SFS for SQL. 1.1 (1999)OGC SFS for SQL. 1.1.0 (2005)OGC SFS for SQL. 1.2.0 (2006)SQL-MM Part 3
----

Examples

SELECT ST_AsEWKT(ST_Force_2D(ST_GeomFromEWKT('LINESTRING (0 0 15, 10 10 25, 20 10 35)')));
--Result
LINESTRING (0 0, 10 10, 20 10)

SELECT ST_AsEWKT(ST_Force_2D(ST_GeomFromEWKT('GEOMETRYCOLLECTION(POINTM(0 0 -4),POINT(5 5 10 -4))')));
--Result
GEOMETRYCOLLECTION (POINT (0 0), POINT (5 5))

Related functions

ST_Force_3D