View a markdown version of this page

ST_Points - Amazon Redshift

Amazon Redshift will no longer support the use of Python UDFs after June 30, 2026. We will start enforcing it in phases. For more information on the details of Python end of life and migration options, see the blog post that was published on June 30, 2025.

ST_Points

ST_Points returns a multipoint geometry containing all nonempty points in the input geometry. ST_Points doesn't remove points that are duplicated in the input, including the start and end points of ring geometries.

Syntax

ST_Points(geom)

Arguments

geom

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

Return type

GEOMETRY of subtype MULTIPOINT.

The spatial reference system identifier (SRID) value of the returned geometry is the same as geom.

If geom is null, then null is returned.

If geom is empty, then the empty multipoint is returned.

Examples

The following SQL examples construct a multipoint geometry from the input geometry. The result is a multipoint geometry containing the nonempty points in the input geometry.

SELECT ST_AsEWKT(ST_Points(ST_SetSRID(ST_GeomFromText('LINESTRING(1 0,2 0,3 0)'), 4326)));
st_asewkt ------------- SRID=4326;MULTIPOINT((1 0),(2 0),(3 0))
SELECT ST_AsEWKT(ST_Points(ST_SetSRID(ST_GeomFromText('MULTIPOLYGON(((0 0,1 0,0 1,0 0)))'), 4326)));
st_asewkt ------------- SRID=4326;MULTIPOINT((0 0),(1 0),(0 1),(0 0))