This topic describes the ST_LineInterpolatePoint function. This function interpolates a point at the specified location of a LineString object and returns the point.


geometry  ST_LineInterpolatePoint(geometry  aLinestring , float8  aFraction);


Parameter Description
aLinestring The LineString object that you want to specify.
aFraction The fraction based on which the point is interpolated into the line. The value of this parameter is a floating-point number within the range of 0 to 1.


  • This function supports 3D objects and does not delete z coordinates.
  • This function supports m coordinates.


  • SELECT ST_AsText(ST_LineInterpolatePoint(geom, 0.5)) FROM (SELECT 'LINESTRING(0 0,2 2)'::geometry as geom) As test;
     POINT(1 1)
    (1 row)
  • Obtain the closest point on a line to a geometry object.
    SELECT ST_AsText(ST_LineInterpolatePoint(geom, ST_LineLocatePoint(geom, 'POINT(1 1)'::geometry))) FROM (SELECT 'LINESTRING(0 0,0 2)'::geometry As geom) As test;
     POINT(0 1)
    (1 row)