Libosmium: osmium::geom::haversine Namespace Reference

Libosmium Fast and flexible C++ library for working with OpenStreetMap data

Loading...
Searching...
No Matches
Functions | Variables
osmium::geom::haversine Namespace Reference

Functions to calculate arc distance on Earth using the haversine formula. More...

## Functions
double | distance (const osmium::geom::Coordinates &c1, const osmium::geom::Coordinates &c2) noexcept
double | distance (const osmium::WayNodeList &wnl)
double | distance (const osmium::NodeRefList &nrl)

## Variables
constexpr const double | EARTH_RADIUS_IN_METERS = 6372797.560856
| Earth's quadratic mean radius for WGS84.

## Detailed Description

Functions to calculate arc distance on Earth using the haversine formula.

See https://en.wikipedia.org/wiki/Haversine_formula

Implementation derived from http://blog.julien.cayzac.name/2008/10/arc-and-distance-between-two-points-on.html

## Function Documentation

## ◆ distance() [1/3]

double osmium::geom::haversine::distance | ( | const osmium::geom::Coordinates & | c1,
|  | const osmium::geom::Coordinates & | c2 )
| inlinenoexcept

Calculate distance in meters between two sets of coordinates.

Precondition
  c1.valid() && c2.valid()

## ◆ distance() [2/3]

double osmium::geom::haversine::distance | ( | const osmium::NodeRefList & | nrl | ) |
| inline

Calculate length of node list.

## ◆ distance() [3/3]

double osmium::geom::haversine::distance | ( | const osmium::WayNodeList & | wnl | ) |
| inline

Calculate length of way.

## Variable Documentation

## ◆ EARTH_RADIUS_IN_METERS

const double osmium::geom::haversine::EARTH_RADIUS_IN_METERS = 6372797.560856
| constexpr

Earth's quadratic mean radius for WGS84.