Name

ST_3DLineInterpolatePoint — Returns a point interpolated along a line in 3D. Second argument is a float8 between 0 and 1 representing fraction of total length of linestring the point has to be located.

Synopsis

geometry ST_3DLineInterpolatePoint(geometry a_linestring, float8 a_fraction);

Description

Returns a point interpolated along a line. First argument must be a LINESTRING. Second argument is a float8 between 0 and 1 representing fraction of total linestring length the point has to be located.

[Note]

ST_LineInterpolatePoint computes resulting point in 2D and then interpolates value for Z and M, while ST_3DLineInterpolatePoint computes directly point in 3D and only M value is interpolated then.

Availability: 3.0.0

Examples

Return point 20% along 3D line

SELECT ST_AsEWKT(ST_3DLineInterpolatePoint(the_line, 0.20))
	FROM (SELECT ST_GeomFromEWKT('LINESTRING(25 50 70, 100 125 90, 150 190 200)') as the_line) As foo;
   st_asewkt
----------------
 POINT(59.0675892910822 84.0675892910822 79.0846904776219)

See Also

ST_AsText, ST_AsEWKT, ST_Length, ST_LineInterpolatePoint ST_LineInterpolatePoints ST_LineLocatePoint