Nome

ST_EndPoint — Returns the last point of a LineString, CircularLineString, or NURBSCurve.

Sinopse

geometry ST_EndPoint(geometry g);

Descrição

Returns the last point of a LINESTRING, CIRCULARLINESTRING, or NURBSCURVE geometry as a POINT. Returns NULL if the input is not a LINESTRING, CIRCULARLINESTRING, or NURBSCURVE.

This method implements the SQL/MM specification. SQL-MM 3: 7.1.4

This function supports 3d and will not drop the z-index.

This method supports Circular Strings and Curves.

Alterações: 2.0.0 não funciona mais com geometrias de multilinestrings. Em verões mais antigas do PostGIS -- uma linha multilinestring sozinha trabalharia normalmente com essa função e voltaria o ponto de início. Na 2.0.0 ela retorna NULA como qualquer outra multilinestring. O antigo comportamento não foi uma característica documentada, mas as pessoas que consideravam que tinham seus dados armazenados como uma LINESTRING, agora podem experimentar essas que retornam NULAS em 2.0.

Exemplos

End point of a LineString

Code
SELECT ST_EndPoint('LINESTRING(1 1,2 2,3 3)'::geometry);
Raster Outputs
POINT(3 3)
Figure
Geometry figure for visual-st-endpoint-01

End point of a non-LineString is NULL

Code
SELECT ST_EndPoint('POINT(1 1)'::geometry) IS NULL AS is_null;
Raster Outputs
t

End point of a 3D LineString

3D endpoint.

Code
SELECT ST_EndPoint('LINESTRING(1 1 2,1 2 3,0 0 5)');
Raster Outputs
POINT(0 0 5)
Figure
Geometry figure for visual-st-endpoint-03

Retorna o número de pontos em um valor ST_LineString ou ST_CircularString.

Code
SELECT ST_EndPoint('CIRCULARSTRING(5 2,-3 2,-2 1,-4 2,6 3)'::geometry);
Raster Outputs
POINT(6 3)
Figure
Geometry figure for visual-st-endpoint-04

End point of a NURBSCurve

Code
SELECT ST_EndPoint('NURBSCURVE(2, (0 0, 1 1, 2 0))'::geometry);
Raster Outputs
POINT(2 0)
Figure
Geometry figure for visual-st-endpoint-05

Veja também

ST_PointN, ST_StartPoint