ST_Force2D¶
Introduction: Forces the geometries into a "2-dimensional mode" so that all output representations will only have the X and Y coordinates. This function is an alias of ST_Force_2D.
Format: ST_Force2D (A:geometry)
Example:
SELECT ST_AsText(
ST_Force2D(ST_GeomFromText('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))'))
) AS geom
Result:
+---------------------------------------------------------------+
|geom |
+---------------------------------------------------------------+
|POLYGON((0 0,0 5,5 0,0 0),(1 1,3 1,1 3,1 1)) |
+---------------------------------------------------------------+