ST_RemovePoint — Removes N th Point from a LineString. N index starts at 0.
varchar ST_RemovePoint(bytea
Geometry, integer N);
Removes N th Point from a LineString or a MultiLineString. N index starts at 0.
![]() | |
GeometryCollection with LineStrings supported |
| 2D | 3D | M |
|---|---|---|
![]() | ![]() | ![]() |
| OGC SFS for SQL. 1.1 (1999) | OGC SFS for SQL. 1.1.0 (2005) | OGC SFS for SQL. 1.2.0 (2006) | SQL-MM Part 3 |
|---|---|---|---|
| - | - | - | - |
SELECT ST_AsEWKT(ST_RemovePoint(ST_GeomFromEWKT('LINESTRING (0 0 15, 10 10 25, 20 10 35)'),0));
--Result
LINESTRING (10 10 25, 20 10 35)
SELECT ST_AsEWKT(ST_RemovePoint(ST_GeomFromEWKT('LINESTRING (0 0 15 -2, 10 10 25 -8, 20 10 35 -4)'),2));
--Result
LINESTRING (0 0 15 -2, 10 10 25 -8)
SELECT ST_AsEWKT(ST_RemovePoint(ST_GeomFromEWKT('MULTILINESTRING ((0 0, 10 10, 20 10),(30 30, 40 40, 50 40))'),5));
--Result
MULTILINESTRING ((0 0, 10 10, 20 10), (30 30, 40 40))
SELECT ST_AsEWKT(
ST_RemovePoint(ST_GeomFromEWKT('
GEOMETRYCOLLECTION(LINESTRING (0 0 15, 10 10 25, 20 10 35),POINT(0 0))'),2));
--Result
GEOMETRYCOLLECTION (LINESTRING (0 0 15, 10 10 25), POINT (0 0 0))