ST_LineInterpolatePoints()

Returns regularly spaced points along a line using a fractional interval.

Syntax

ST_LineInterpolatePoints(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

fraction must be greater than 0 and no greater than 1; the result is a MULTIPOINT. Source evidence: test/distributed/cases/geo/geo_lineref.sql.

Examples

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

SELECT ST_AsText(ST_LineInterpolatePoints(ST_GeomFromText('LINESTRING(0 0,10 0)'), 0.25)) AS result_geometry;

DROP DATABASE geo_operation_demo;

See Also

Geo Functions Overview