1 #ifndef OSMIUM_GEOM_HAVERSINE_HPP
2 #define OSMIUM_GEOM_HAVERSINE_HPP
72 return 2.0 * EARTH_RADIUS_IN_METERS * asin(sqrt(lath + tmp*lonh));
79 double sum_length = 0;
81 for (
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());
96 #endif // OSMIUM_GEOM_HAVERSINE_HPP
double y
Definition: coordinates.hpp:51
double distance(const osmium::geom::Coordinates &c1, const osmium::geom::Coordinates &c2)
Definition: haversine.hpp:66
constexpr const double EARTH_RADIUS_IN_METERS
Earth's quadratic mean radius for WGS84.
Definition: haversine.hpp:59
Namespace for everything in the Osmium library.
Definition: assembler.hpp:73
constexpr double deg_to_rad(double degree) noexcept
Convert angle from degrees to radians.
Definition: util.hpp:62
Definition: coordinates.hpp:48
iterator begin() noexcept
Returns an iterator to the beginning.
Definition: node_ref_list.hpp:196
iterator end() noexcept
Returns an iterator to the end.
Definition: node_ref_list.hpp:201
double x
Definition: coordinates.hpp:50