PostGIS

ST_Project

Prev

7.5. Geometry Editors

Next

Name

ST_Project — Returns a point projected from a start point by a distance and bearing (azimuth).

Synopsis

geometry +`*`+ST_Project*(`geometry `g1, float distance, float azimuth`)`;

geometry +`*`+ST_Project*(`geometry `g1, geometry g2, float distance`)`;

geography +`*`+ST_Project*(`geography `g1, float distance, float azimuth`)`;

geography +`*`+ST_Project*(`geography `g1, geography g2, float distance`)`;

Description

Returns a point projected from a point along a geodesic using a given distance and azimuth (bearing). This is known as the direct geodesic problem.

The two-point version uses the path from the first to the second point to implicitly define the azimuth and uses the distance as before.

The distance is given in meters. Negative values are supported.

The azimuth (also known as heading or bearing) is given in radians. It is measured clockwise from true north.

  • North is azimuth zero (0 degrees)

  • East is azimuth π/2 (90 degrees)

  • South is azimuth π (180 degrees)

  • West is azimuth 3π/2 (270 degrees)

Negative azimuth values and values greater than 2π (360 degrees) are supported.

Availability: 2.0.0

Enhanced: 2.4.0 Allow negative distance and non-normalized azimuth.

Enhanced: 3.4.0 Allow geometry arguments and two-point form omitting azimuth.

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

Prev

Up

Next

ST_Normalize

Home

ST_QuantizeCoordinates