ST_LineInterpolatePoint()

Returns the point at a fraction of a line’s total length.

Syntax

ST_LineInterpolatePoint(line, fraction)

Arguments

Argument

Description

line

A LINESTRING in GEOMETRY or GEOMETRY32.

fraction

FLOAT64 position along the line.

Return Value

Returns a geometry in the same geometry family as the input.

Usage Notes

Examples

DROP DATABASE IF EXISTS geo_operation_demo;
CREATE DATABASE geo_operation_demo;
USE geo_operation_demo;

SELECT ST_AsText(ST_LineInterpolatePoint(ST_GeomFromText('LINESTRING(0 0,10 0)'), 0.5)) AS result_geometry;

DROP DATABASE geo_operation_demo;

See Also

Geo Functions Overview