Strips all dimensions except x and y from a geometry object, returning a 2D geometry.
Syntax
geometry ST_Force2D(geometry geomA);Parameters
| Parameter | Description |
|---|---|
geomA | The geometry object to convert to 2D. |
Description
The output geometry retains only the x and y coordinates.
Supported geometry types include circular strings, curves, polyhedral surfaces, triangles, triangulated irregular network (TIN) surfaces, and 3D objects.
Examples
SELECT ST_AsEWKT(ST_Force2D(ST_GeomFromEWKT('POINT(1 2 3)')));Output:
st_asewkt
------------
POINT(1 2)
(1 row)该文章对您有帮助吗?