跳转至
🎉 SedonaDB 0.4.0 已正式发布!🗺️ 新增 Python DataFrame API、R dplyr 接口、Geography 支持及 GPU 加速空间连接。阅读发布博客 →

ST_SetPoint

Introduction: Replace Nth point of linestring with given point. Index is 0-based. Negative index are counted backwards, e.g., -1 is last point.

ST_SetPoint

Format: ST_SetPoint (linestring: Geometry, index: Integer, point: Geometry)

Return type: Geometry

Since: v1.3.0

Example:

SELECT ST_SetPoint(ST_GeomFromText('LINESTRING (0 0, 0 1, 1 1)'), 2, ST_GeomFromText('POINT (1 0)'))

Output:

LINESTRING (0 0, 0 1, 1 0)