1 #ifndef OSMIUM_OSM_BOX_HPP 2 #define OSMIUM_OSM_BOX_HPP 60 constexpr
Box() noexcept :
70 Box(
double minx,
double miny,
double maxx,
double maxy) :
73 assert(minx <= maxx && miny <= maxy);
110 if (location.valid()) {
140 extend(box.bottom_left());
148 explicit constexpr
operator bool() const noexcept {
156 constexpr
bool valid() const noexcept {
222 return lhs.bottom_left() == rhs.bottom_left() &&
223 lhs.top_right() == rhs.top_right();
232 template <
typename TChar,
typename TTraits>
233 inline std::basic_ostream<TChar, TTraits>& operator<<(std::basic_ostream<TChar, TTraits>& out,
const osmium::Box& box) {
238 << box.bottom_left().lat()
240 << box.top_right().lon()
242 << box.top_right().lat()
245 out <<
"(undefined)";
252 #endif // OSMIUM_OSM_BOX_HPP osmium::Location m_bottom_left
Definition: box.hpp:51
double lon() const
Definition: location.hpp:401
Location & top_right() noexcept
Definition: box.hpp:184
bool contains(const osmium::Location &location) const noexcept
Definition: box.hpp:194
constexpr bool operator==(const Box &lhs, const Box &rhs) noexcept
Definition: box.hpp:221
constexpr Location top_right() const noexcept
Definition: box.hpp:177
Box & extend(const Location &location) noexcept
Definition: box.hpp:109
double lat() const
Definition: location.hpp:420
constexpr bool valid() const noexcept
Definition: location.hpp:353
Box & operator=(const Box &)=default
Namespace for everything in the Osmium library.
Definition: assembler.hpp:53
Box & extend(const Box &box) noexcept
Definition: box.hpp:139
osmium::Location m_top_right
Definition: box.hpp:52
constexpr bool valid() const noexcept
Definition: box.hpp:156
constexpr int32_t y() const noexcept
Definition: location.hpp:382
Location & bottom_left() noexcept
Definition: box.hpp:170
Location & set_y(const int32_t y) noexcept
Definition: location.hpp:391
Box(const osmium::Location &bottom_left, const osmium::Location &top_right)
Definition: box.hpp:85
Definition: location.hpp:273
Location & set_x(const int32_t x) noexcept
Definition: location.hpp:386
constexpr Location bottom_left() const noexcept
Definition: box.hpp:163
Box(double minx, double miny, double maxx, double maxy)
Definition: box.hpp:70
constexpr int32_t x() const noexcept
Definition: location.hpp:378
double size() const
Definition: box.hpp:210
constexpr Box() noexcept
Definition: box.hpp:60