Name

ST_LineInterpolatePoints — 返回以分数间隔沿线插值点。

Synopsis

geometry ST_LineInterpolatePoints(geometry a_linestring, float8 a_fraction, boolean repeat);

描述

返回以分数间隔沿直线插补的一个或多个点。第一个参数必须是LINESTRING。第二个参数是一个介于0和1之间的浮点数8,它将点之间的间距表示为线长度的一部分。如果第三个参数为假,则最多构造一个点(相当于 ST_LineInterpolatePoint 。)

如果结果有零个点或一个点,则作为点返回。如果它有两个或多个点,则作为多点返回。

可用性:2.5.0

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

This function supports M coordinates.

示例

点每隔20%内插的线串

--Return points each 20% along a 2D line
SELECT ST_AsText(ST_LineInterpolatePoints('LINESTRING(25 50, 100 125, 150 190)', 0.20))
----------------
 MULTIPOINT((51.5974135047432 76.5974135047432),(78.1948270094864 103.194827009486),(104.132163186446 130.37181214238),(127.066081593223 160.18590607119),(150 190))

另请参阅

ST_LineInterpolatePoint, ST_LineLocatePoint