Skip to content
πŸŽ‰ Apache Sedona 1.9.1 is out now! πŸ—ΊοΈ Geography SQL functions, Box2D & Box3D types, raster Python UDFs & more. Read the release notes β†’

ST_InterpolatePoint

Introduction: Returns the interpolated measure value of a linear measured LineString at the point closest to the specified point.

Note

Make sure that both geometries have the same SRID, otherwise the function will throw an IllegalArgumentException.

ST_InterpolatePoint

Format: ST_InterpolatePoint(linestringM: Geometry, point: Geometry)

Return type: Double

Since: v1.7.0

SQL Example

SELECT ST_InterpolatePoint(
    ST_GeomFromWKT("LINESTRING M (0 0 0, 2 0 2, 4 0 4)"),
    ST_GeomFromWKT("POINT (1 1)")
    )

Output:

1.0