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_EndPoint

Focus mode
ST_EndPoint - Amazon Redshift

ST_EndPoint returns the last point of an input linestring. The spatial reference system identifier (SRID) value of the result is the same as that of the input geometry. The dimension of the returned geometry is the same as that of the input geometry.

Syntax

ST_EndPoint(geom)

Arguments

geom

A value of data type GEOMETRY or an expression that evaluates to a GEOMETRY type. The subtype must be LINESTRING.

Return type

GEOMETRY

If geom is null, then null is returned.

If geom is empty, then null is returned.

If geom isn't a LINESTRING, then null is returned.

Examples

The following SQL returns an extended well-known text (EWKT) representation of a four-point LINESTRING to a GEOMETRY object and returns the end point of the linestring.

SELECT ST_AsEWKT(ST_EndPoint(ST_GeomFromText('LINESTRING(0 0,10 0,10 10,5 5,0 5)',4326)));
st_asewkt ------------- SRID=4326;POINT(0 5)

On this page

PrivacySite termsCookie preferences
© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved.