Libosmium
2.15.1
Fast and flexible C++ library for working with OpenStreetMap data
|
Go to the documentation of this file. 1 #ifndef OSMIUM_GEOM_HAVERSINE_HPP
2 #define OSMIUM_GEOM_HAVERSINE_HPP
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 x
Definition: coordinates.hpp:50
iterator end() noexcept
Returns an iterator to the end.
Definition: node_ref_list.hpp:204
constexpr const double EARTH_RADIUS_IN_METERS
Earth's quadratic mean radius for WGS84.
Definition: haversine.hpp:59
iterator begin() noexcept
Returns an iterator to the beginning.
Definition: node_ref_list.hpp:199
Namespace for everything in the Osmium library.
Definition: assembler.hpp:53
double y
Definition: coordinates.hpp:51
constexpr double deg_to_rad(double degree) noexcept
Convert angle from degrees to radians.
Definition: util.hpp:62
Definition: coordinates.hpp:48
double distance(const osmium::geom::Coordinates &c1, const osmium::geom::Coordinates &c2)
Definition: haversine.hpp:66