This topic describes the ST_InterpolatePoint function. This function returns the m coordinate of the closest point in a geometry object to a point object.

Syntax

float8  ST_InterpolatePoint(geometry  line , geometry  point);

Parameters

ParameterDescription
lineThe LineString object that you want to specify.
pointThe point object that you want to specify.

Description

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

Examples

SELECT ST_InterpolatePoint('LINESTRING M (0 0 0, 2 0 2)', 'POINT(1 1)');
 st_interpolatepoint
---------------------
                   1
(1 row)