ArcGIS Server Banner

ST_EndPoint

ST_EndPoint

Release 9.3 E-mail This TopicPrintable VersionGive Us feedback
Note: This topic was updated for 9.3.1.

Definition

ST_EndPoint returns the last point of a linestring.

Syntax

Oracle

sde.st_endpoint (ln1 sde.st_geometry)

PostgreSQL

st_endpoint (ln1 st_geometry)

Return type

ST_Point

Example

The endpoint_test table stores the gid integer column, which uniquely identifies each row, and the ln1 ST_LineString column, which stores linestrings.

Oracle

CREATE TABLE endpoint_test (gid integer, ln1 sde.st_geometry);

PostgreSQL

CREATE TABLE endpoint_test (gid integer, ln1 st_geometry);

The INSERT statements insert linestrings into the endpoint_test table. The first linestring doesn't have z-coordinates or measures, while the second one does.

Oracle

INSERT INTO endpoint_test VALUES (
1,
sde.st_linefromtext ('linestring (10.02 20.01, 23.73 21.92, 30.10 40.23)', 0)
);

INSERT INTO endpoint_test VALUES (
2,
sde.st_linefromtext ('linestring zm(10.02 20.01 5.0 7.0, 23.73 21.92 6.5 7.1,30.10 40.23 6.9 7.2)', 0)
);

PostgreSQL

INSERT INTO endpoint_test VALUES (
1,
st_linestring ('linestring (10.02 20.01, 23.73 21.92, 30.10 40.23)', 0)
);

INSERT INTO endpoint_test VALUES (
2,
st_linestring ('linestring zm(10.02 20.01 5.0 7.0, 23.73 21.92 6.5 7.1,30.10 40.23 6.9 7.2)', 0)
);

The query lists the gid column with the output of the ST_EndPoint function. The ST_EndPoint function generates an ST_Point geometry.

Oracle

SELECT gid, sde.st_astext (sde.st_endpoint (ln1)) Endpoint
FROM endpoint_test;

GID    Endpoint                       

 1    POINT (30.10 40.23)
 2    POINT ZM (30.10 40.23 6.9 7.2)

PostgreSQL

SELECT gid, st_astext (st_endpoint (ln1)) AS Endpoint
FROM endpoint_test;

gid    endpoint                       

 1    POINT (30.10 40.23)
 2    POINT ZM (30.10 40.23 6.9 7.2)

See Also

  • An overview of SQL functions used with ST_Geometry types