ST_StartPoint — Returns the first point of a LineString, CircularLineString, or NURBSCurve.
geometry ST_StartPoint(geometry geomA);
Returns the first point of a LINESTRING, CIRCULARLINESTRING, or NURBSCURVE geometry as a POINT. For other geometries, returns the first point in coordinate order.
Questo metodo implementa la specifica SQL/MM. SQL-MM 3: 7.1.3
Questa funzione supporta il 3d e non distrugge gli z-index.
Questo metodo supporta le Curve e le Circular String.
|
|
|
Enhanced: 3.2.0 returns a point for all geometries. Prior behavior returns NULLs if input was not a LineString. Modifica: La versione 2.0.0 non funziona più con geometrie singole di stringhe multilinea. Nelle versioni precedenti di PostGIS una stringa multilinea con una sola linea avrebbe funzionato tranquillamente con questa funzione, restituendo il punto di inizio. Nella versione 2.0.0 la funzione restituisce NULL come per qualsiasi altra stringa multilinea. Il comportamento precedente non era documentato, ma le persone che presumevano di avere i dati memorizzati come LINESTRING potrebbero trovare che questi ora restituiscono il valore NULL. |
Start point of a LineString
SELECT ST_AsText(ST_StartPoint('LINESTRING(0 1, 0 2)'::geometry));
POINT(0 1)
Start point of a Point is the Point itself
SELECT ST_AsText(ST_StartPoint('POINT(0 1)'::geometry));
POINT(0 1)
Start point of a 3D LineString
SELECT ST_AsEWKT(ST_StartPoint('LINESTRING(0 1 1, 0 2 2)'::geometry));
POINT(0 1 1)
Start point of a CircularString
SELECT ST_AsText(ST_StartPoint('CIRCULARSTRING(5 2,-3 2, -2 1, -4 2, 6 3)'::geometry));
POINT(5 2)
Start point of a NURBSCurve
SELECT ST_AsText(ST_StartPoint('NURBSCURVE(2, (0 0, 1 1, 2 0))'::geometry));
POINT(0 0)