Select your cookie preferences

We use essential cookies and similar tools that are necessary to provide our site and services. We use performance cookies to collect anonymous statistics, so we can understand how customers use our site and make improvements. Essential cookies cannot be deactivated, but you can choose “Customize” or “Decline” to decline performance cookies.

If you agree, AWS and approved third parties will also use cookies to provide useful site features, remember your preferences, and display relevant content, including relevant advertising. To accept or decline all non-essential cookies, choose “Accept” or “Decline.” To make more detailed choices, choose “Customize.”

ST_Force3DM - Amazon Redshift

ST_Force3DM

ST_Force3DM returns a 3DM geometry of the input geometry. For 2D geometries, the m coordinates of the nonempty points in the output geometry are all set to 0. For 3DM geometries, a copy of the input geometry is returned. For 3DZ geometries, the geometry is projected to the xy-Cartesian plane, and the m coordinates of the nonempty points in the output geometry are all set to 0. For 4D geometries, the geometry is projected to the xym-Cartesian space. Empty points in the input geometry remain empty points in the output geometry.

Syntax

ST_Force3DM(geom)

Arguments

geom

A value of data type GEOMETRY or an expression that evaluates to a GEOMETRY type.

Return type

GEOMETRY.

The spatial reference system identifier (SRID) value of the returned geometry is the SRID value of the input geometry.

If geom is null, then null is returned.

If geom is empty, then an empty geometry is returned.

Examples

The following SQL returns a 3DM geometry from a 3DZ geometry.

SELECT ST_AsEWKT(ST_Force3DM(ST_GeomFromText('MULTIPOINT Z(0 1 2, EMPTY, 2 3 4, 5 6 7)')));
st_asewkt ----------- MULTIPOINT M ((0 1 0),EMPTY,(2 3 0),(5 6 0))
PrivacySite termsCookie preferences
© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved.