Documentation
¶
Overview ¶
Package geolib provides Geographical functions for Golang apps!
Index ¶
Constants ¶
This section is empty.
Variables ¶
var GreatEarthCircleRadiusKM = 6372.8
GreatEarthCircleRadiusKM varies between 6,378km and 6,357km (equatorial and polar). The local radius of curvature varies between 6,336km and 6,399km (equatorial meridian and polar)
Functions ¶
func Bearing ¶
Bearing {from, to} a point flag: 0 => Initial Bearing flag: 1 => Initial Bearing flag: nil => Bearing Result:
- Type: float64
- Metric: Degress from North
func EquirectangularDistance ¶
EquirectangularDistance calculates the distance in KM of 2 points using Pythagoras’ theorem. It is a faster alternative to the Haversine_Distance function with less accuracy. Scope: small distance calculation Result:
- Type: float64
- Result: Distance (km)
func HaversineDistance ¶
HaversineDistance calculates the great-circle distance between 2 points. The function uses a spherical model, since the earth is more is oblate spheroidal, there will be an accuracy error margin. Scope: Distance computation below 0.3% accuracy error margin Result:
- Type: float64
- Metric: Distance (km)