Friday, February 28, 2025

Calculate bearing of lines in QGIS

 Bearing refers to the direction or orientation of a line or object relative to a fixed reference point, typically north. It is often measured in degrees, with 0° representing north, 90° representing east, 180° representing south, and 270° representing west. In simpler terms, bearing is like a compass pointing in a specific direction.

Bearings are commonly used in the field of Navigation, Surveying, Astronomy and Engineering. In some instances, different discipline use different terms such as Azimuth, Heading, Direction, Course etc to refer to bearing.

As at the time of writing, calculating the bearing of a line in QGIS doesn't work well for the context of surveying in Nigeria. Nigerian land surveyors work with Whole Circle Bearing (WCB) which is a method of expressing direction using degrees measured clockwise from north. WCB values range from 0° to 360° where North is 0°, East is 90°, South is 180° and West is 270°.



In QGIS under the "Measure" tool/icon, you will find "Measure Bearing" tool. Currently, the bearing is in Quadrant format.

In this post, lets explore how to calculate the Whole Circle Bearing of lines and use it to label the lines.


BEARING

concat(floor(degrees(azimuth(start_point($geometry), end_point($geometry)))), '°      ', floor(degrees(azimuth(start_point($geometry), end_point($geometry)))*60 % 60), ''' ')



DISTANCE

$length



AREA (Ha)

$area/10000











No comments:

Post a Comment