Removes a point at the specified index from a LineString object.
Syntax
geometry ST_RemovePoint(geometry linestring, integer offset)Parameters
| Parameter | Description |
|---|---|
| linestring | The LineString geometry object. |
| offset | The zero-based index of the point to remove. |
Description
The index starts from 0.
ST_RemovePoint is useful for converting a closed ring into a nonclosed LineString object.
This function supports 3D objects and does not delete z coordinates.
Examples
SELECT ST_AsText(ST_RemovePoint(ST_GeomFromText('LINESTRING(2 1,1 1,1 0)'),0));
st_astext
---------------------
LINESTRING(1 1,1 0)
(1 row)该文章对您有帮助吗?