ST_ADDPOINT
Adds aPOINT to the given LINESTRING at the specified 0-indexed location.
Syntax
SQL
Example
SQL
LINESTRING(1.000000 2.000000, 1.000000 4.000000, 1.000000 3.000000)
ST_ENDPOINT
Returns the endpoint of a specifiedLINESTRING. The returned value is a POINT.
Syntax
SQL
Example
SQL
POINT(1,4)
ST_LINEINTERPOLATEPOINT
Returns aPOINT along a LINESTRING based on a specified fraction of its total length.
Syntax
SQL
Example
In this example, the function computes a point halfway (0.5) along the specified line.
SQL
POINT(1.5 1.5)
ST_LINELOCATEPOINT
Similar to ST_LINEINTERPOLATEPOINT, this function computes a fraction based on where a specifiedPOINT is located along the length of a specified LINESTRING.
Syntax
SQL
Example
In this example, the function computes a fraction that represents where the point (1.5, 1.5) lies along the line.
SQL
0.5
ST_LINESUBSTRING
Returns aLINESTRING that is a substring of a specified line that starts and ends at the specified fractions of its total length.
Syntax
SQL
Example
In this example, the function generates a subsection of the provided linestring, spanning from the
start_fraction value (0.5) that represents the halfway point of the original linestring, to the end_fraction value (1.0) that represents the endpoint.
SQL
LINESTRING(1.50 1.50, 2.0 1.0)
ST_POINTN
Returns thePOINT value at a specified index of the specified LINESTRING. If out of bounds, the function returns NULL.
Syntax
SQL
Example
SQL
ST_POINT(1,4)
ST_REMOVEPOINT
Removes aPOINT value at a specified index from the specified line.
Syntax
SQL
Example
SQL
LINESTRING(1.0 2.0, 1.0 4.0)
ST_SETPOINT
Replaces aPOINT value in a specified LINESTRING at a specified index. The function returns the altered LINESTRING with the replaced point.
Syntax
SQL
Example
In this example, the function replaces the point value located at the
-2 index location, meaning it is the second from the last in the sequence.
SQL
LINESTRING(1.000000 2.000000, 1.000000 5.000000, 1.000000 4.000000)
ST_STARTPOINT
Returns the startingPOINT value of the line. If this value is empty, the function returns NULL. If you specify a POLYGON, POINT, or NULL, then the function returns NULL. If you specify a non-geography value, the function throws an error.
Syntax
SQL
Example
SQL
ST_POINT(1,2)

