1#ifndef OSMIUM_GEOM_HAVERSINE_HPP
2#define OSMIUM_GEOM_HAVERSINE_HPP
67 double lonh = std::sin(
deg_to_rad(c1.x - c2.x) * 0.5);
69 double lath = std::sin(
deg_to_rad(c1.y - c2.y) * 0.5);
79 double sum_length = 0;
81 for (
const auto* it = wnl.
begin(); it != wnl.
end(); ++it) {
82 if (std::next(it) != wnl.
end()) {
83 sum_length +=
distance(it->location(), std::next(it)->location());
94 double sum_length = 0;
96 for (
const auto* it = nrl.
begin(); it != nrl.
end(); ++it) {
97 if (std::next(it) != nrl.
end()) {
98 sum_length +=
distance(it->location(), std::next(it)->location());
Definition: node_ref_list.hpp:52
iterator begin() noexcept
Returns an iterator to the beginning.
Definition: node_ref_list.hpp:199
iterator end() noexcept
Returns an iterator to the end.
Definition: node_ref_list.hpp:204
double distance(const osmium::geom::Coordinates &c1, const osmium::geom::Coordinates &c2) noexcept
Definition: haversine.hpp:66
constexpr const double EARTH_RADIUS_IN_METERS
Earth's quadratic mean radius for WGS84.
Definition: haversine.hpp:59
constexpr double deg_to_rad(double degree) noexcept
Convert angle from degrees to radians.
Definition: util.hpp:64
Namespace for everything in the Osmium library.
Definition: assembler.hpp:53
Definition: coordinates.hpp:48