Syntax of osmnx.bearing.calculate_bearing() Function
osmnx.bearing.calculate_bearing(lat1, lon1, lat2, lon2)
Parameters:
- lat1 (float or numpy.array of float) – first point’s latitude coordinate
- lon1 (float or numpy.array of float) – first point’s longitude coordinate
- lat2 (float or numpy.array of float) – second point’s latitude coordinate
- lon2 (float or numpy.array of float) – second point’s longitude coordinate
Returns: bearing – the bearing(s) in decimal degrees
Return Type: float or numpy.array of float
Calculate Compass Bearing Using Python OSMnx Bearing Module
Bearing is a significant angle for Geographic Information System (GIS) applications. In this article, we will see how to calculate the compass Bearing using the OSMnx bearing module based on lat-Ion Points.
What is Bearing?
Bearing represents the clockwise angle in degrees between the north and the geodesic line from (lat1, lon1) to (lat2, lon2). It is used to define navigation commonly in the fields of street network modeling, vehicle navigation, aircraft or marine navigation, or land surveying. Bearings are always measured from the North, in a clockwise direction. Refer to the below diagram:
- FIG 1.1 depicts the different bearings measured from north in clockwise direction.
- FIG 1.2 depicts, B bears 55° from A when measured from North in clockwise direction. A and B can be replaced with actual coordinates.
Contact Us