ST_Project
What is ST_Project?
ST_Project returns a point at the specified distance and azimuth from a start point. It is typically called on a geography to produce great-circle destinations in metres, but a geometry overload exists since PostGIS 3.4.
1ST_Project(geography g1, float distance, float azimuth) → geography
2ST_Project(geography g1, geography g2, float distance) → geography
3ST_Project(geometry g1, float distance, float azimuth) → geometry
4ST_Project(geometry g1, geometry g2, float distance) → geometryDistance is in metres for geography, in CRS units for geometry. Azimuth is in radians, measured clockwise from north.
When would you use ST_Project?
Use ST_Project to compute destinations given a bearing — placing a search point N metres northeast of a known address, projecting a pipeline endpoint along a survey azimuth, or generating synthetic test points at known great-circle distances. It is the safe way to produce points at a known metric distance on geography without switching CRSs.
In logistics, ST_Project computes the destination of a vehicle moving at a known speed and heading after a given duration — a useful primitive for arrival-time predictions.
FAQs
What units does ST_Project use for azimuth?
Radians, measured clockwise from geographic north. Convert degrees with radians(angle_deg).
What is the difference between geography and geometry overloads?
The geography overload performs great-circle projection on the ellipsoid, producing metre-accurate results anywhere on Earth. The geometry overload is planar and interprets distance in the CRS's native units.
When was the geometry overload added?
PostGIS 3.4. Earlier versions support only the geography form (added in 2.4).
How is ST_Project related to ST_Azimuth?
They are inverses. Given two points A and B, ST_Azimuth(A, B) is the bearing from A to B, and ST_Project(A, ST_Distance(A::geography, B::geography), bearing) reconstructs B.