PostGIS

ST_RemovePoint

Prev

8.5. Geometry Editors

Next

Name

ST_RemovePoint — Remove a point from a linestring.

Synopsis

geometry +`*`+ST_RemovePoint*(`geometry `linestring, integer offset`)`;

Description

Removes a point from a LineString, given its index (0-based). Useful for turning a closed line (ring) into an open linestring.

Enhanced: 3.2.0

Availability: 1.1.0

check This function supports 3d and will not drop the z-index.

Examples

Guarantees no lines are closed by removing the end point of closed lines (rings). Assumes geom is of type LINESTRING

UPDATE sometable
    SET geom = ST_RemovePoint(geom, ST_NPoints(geom) - 1)
    FROM sometable
    WHERE ST_IsClosed(geom);

See Also

Prev

Up

Next

ST_QuantizeCoordinates

Home

ST_RemoveRepeatedPoints