Few things cause quieter data bugs than direction conventions. A surveyor’s field notes, a navigation app, and a Turf.js calculation can all describe the same direction with three different numbers — and if you mix them without converting, everything still runs, it’s just wrong.
The three conventions you’ll actually meet
- Azimuth (0–360°): measured clockwise from north. East is 90°, south is 180°, west is 270°. The standard in surveying, artillery, astronomy and most navigation instruments.
- Signed bearing (-180° to +180°): positive east of north, negative west of north. South is ±180°, west is -90°. This is what Turf.js, PostGIS’s
ST_Azimuth-derived workflows and many GIS libraries return — which surprises people expecting compass values. - Quadrant bearing (N 45° E): the classic surveyor’s notation — an angle up to 90° referenced from north or south, toward east or west. Still standard on legal descriptions and older survey plats.
Converting between them
The azimuth ↔ signed-bearing conversion is a one-liner — subtract 360° from azimuths over 180°, add 360° to negative bearings — but it’s exactly the kind of one-liner that grows sign errors at the boundaries (is -180° or +180° canonical? what happens at exactly 360°?). For spot checks and for sanity-checking a batch of values, a bearing to azimuth converter handles both directions and the edge cases, with a reference table of the cardinal and intercardinal directions in each convention.
For quadrant bearings there’s a companion quadrant bearing converter that translates N 32° 15′ W-style notation to and from decimal azimuths — useful when transcribing metes-and-bounds descriptions into GIS.
Where this bites in real workflows
- Line-of-sight and viewshed tools usually want azimuths; if you feed them Turf.js bearings, everything west of north points the wrong way.
- Wind and aspect data are azimuth-convention by long tradition (a 270° wind is from the west — a separate trap).
- Radians vs degrees: PostGIS’s
ST_Azimuthreturns radians, not degrees. If your azimuths are all under 6.3, that’s why — run them through a degrees–radians converter first.
Direction conventions sit alongside coordinate systems in the category of “things that are trivial until they silently ruin an analysis.” For the coordinate-system half of that story, see our practical guide to Web Mercator and WGS84.













