ST_AppendPoint function
The ST_AppendPoint function takes a curve and a point as input parameters and extends the curve by the specified point. If the specified curve has Z or M coordinates, then the point must also have Z or M coordinates. The resulting curve is represented in the spatial reference system of the specified curve.
If the point to be appended is not represented in the same spatial reference system as the curve, it will be converted to the other spatial reference system.
If the specified curve is closed or simple, the resulting curve might not be closed or simple anymore. If the specified curve or point is null, or if the curve is empty, then null is returned. If the point to be appended is empty, then the specified curve is returned unchanged and a warning is raised (SQLSTATE 01HS3).
Syntax
Parameter
- curve
- A value of type ST_Curve or one of its subtypes that represents the curve to which point will be appended.
- point
- A value of type ST_Point that represents the point that is appended to curve.
Return type
ST_Curve
Examples
In the following examples, the lines of results have been reformatted for readability. The spacing in your results will vary according to your online display.
CREATE TABLE sample_lines(id integer, line ST_Linestring)
INSERT INTO sample_lines VALUES
(1, ST_LineString('linestring (10 10, 10 0, 0 0 )', 0) )
INSERT INTO sample_lines VALUES
(2, ST_LineString('linestring z (0 0 4, 5 5 5, 10 10 6)', 0) )