Description
Returns the initial bearing from starting point (point1) to an ending point (point2) from two point geometries.
Syntax
MI_Bearing ( point1, point2 )
MI_Bearing ( point1, point2, scale)
MI_Bearing ( point1, point2, scale, format)
Arguments
point1 is the starting point geometry
point2 is the ending point geometry
scale is the count of decimal digits in the fractional part (>=0 default is 1)
format is the output format of Quadrant Bearing. (d - Degrees, dms - Degrees/Minutes/Seconds)
Example
Returns the bearing as Polar direction
MI_Bearing(MI_POINT(-94.581213, 39.099912,'epsg:4326'), MI_POINT(-90.200203, 38.627089,'epsg:4326'), 2)
returns a Double 96.51Returns the bearing as quadrant bearing, in Degrees format
MI_Bearing(MI_POINT(-94.581213, 39.099912,'epsg:4326'), MI_POINT(-90.200203, 38.627089,'epsg:4326'), 2, 'd')
returns a String S83.49°EReturns the bearing as quadrant bearing, in Degrees/Minutes/Seconds format
MI_Bearing(MI_POINT(-94.581213, 39.099912,'epsg:4326'), MI_POINT(-90.200203, 38.627089,'epsg:4326'), 2, 'dms')
returns a String S83°29'14.55"ERemarks
- Bearing is measured from 0 degrees to the north, moving in a clockwise direction.
- Bearing is always returned in the WGS84 coordinate system and is the initial bearing from the start point based on a spherical calculation (great circle line).