Name

ST_LineExtend — Returns a line with the last and first segments extended the specified distance(s).

Synopsis

geometry ST_LineExtend(geometry line, float distance_forward, float distance_backward=0.0);

Description

Returns a line with the last and first segments extended the specified distance(s). Distance of zero carries out no extension. Only non-negative distances are allowed. The first (and last) two distinct points in a line are used to determine the direction of projection, duplicate points are ignored.

Availability: 3.4.0

Example: Projected point at 100,000 meters and bearing 45 degrees

SELECT ST_AsText(ST_Project('POINT(0 0)'::geography, 100000, radians(45.0)));
--------------------------------------------
 POINT(0.635231029125537 0.639472334729198)

See Also

ST_LocateAlong, ST_Project