1#ifndef OSMIUM_GEOM_COORDINATES_HPP
2#define OSMIUM_GEOM_COORDINATES_HPP
57 x(
std::numeric_limits<
double>::quiet_NaN()),
58 y(
std::numeric_limits<
double>::quiet_NaN()) {
87 return !std::isnan(
x) && !std::isnan(
y);
122 void append_to_string(std::string& s,
const char prefix,
const char infix,
const char suffix,
int precision)
const {
140 if (!lhs.valid() && !rhs.valid()) {
143#pragma GCC diagnostic push
144#pragma GCC diagnostic ignored "-Wfloat-equal"
145 return lhs.x == rhs.x && lhs.y == rhs.y;
146#pragma GCC diagnostic pop
150 return !(lhs == rhs);
153 template <
typename TChar,
typename TTraits>
154 inline std::basic_ostream<TChar, TTraits>&
operator<<(std::basic_ostream<TChar, TTraits>& out,
const Coordinates& c) {
155 return out <<
'(' << c.x <<
',' << c.y <<
')';
Definition: location.hpp:271
std::basic_ostream< TChar, TTraits > & operator<<(std::basic_ostream< TChar, TTraits > &out, const Coordinates &c)
Definition: coordinates.hpp:154
bool operator!=(const Coordinates &lhs, const Coordinates &rhs) noexcept
Definition: coordinates.hpp:149
bool operator==(const Coordinates &lhs, const Coordinates &rhs) noexcept
Definition: coordinates.hpp:139
T double2string(T iterator, double value, int precision)
Definition: double.hpp:56
Namespace for everything in the Osmium library.
Definition: assembler.hpp:53
Definition: location.hpp:555
Definition: coordinates.hpp:48
void append_to_string(std::string &s, const char prefix, const char infix, const char suffix, int precision) const
Definition: coordinates.hpp:122
bool valid() const noexcept
Definition: coordinates.hpp:86
double y
Definition: coordinates.hpp:51
Coordinates(double cx, double cy) noexcept
Definition: coordinates.hpp:65
void append_to_string(std::string &s, const char infix, int precision) const
Definition: coordinates.hpp:100
double x
Definition: coordinates.hpp:50
Coordinates(const osmium::Location &location)
Definition: coordinates.hpp:78
Coordinates() noexcept
Definition: coordinates.hpp:56