1 #ifndef OSMIUM_OSM_BOX_HPP 2 #define OSMIUM_OSM_BOX_HPP 60 constexpr
Box() noexcept = default;
67 Box(
double minx,
double miny,
double maxx,
double maxy) :
70 assert(minx <= maxx && miny <= maxy);
101 if (location.valid()) {
131 extend(box.bottom_left());
139 explicit constexpr
operator bool() const noexcept {
147 constexpr
bool valid() const noexcept {
213 return lhs.bottom_left() == rhs.bottom_left() &&
214 lhs.top_right() == rhs.top_right();
223 template <
typename TChar,
typename TTraits>
224 inline std::basic_ostream<TChar, TTraits>& operator<<(std::basic_ostream<TChar, TTraits>& out,
const osmium::Box& box) {
229 << box.bottom_left().lat()
231 << box.top_right().lon()
233 << box.top_right().lat()
236 out <<
"(undefined)";
243 #endif // OSMIUM_OSM_BOX_HPP osmium::Location m_bottom_left
Definition: box.hpp:51
double lon() const
Definition: location.hpp:395
Location & top_right() noexcept
Definition: box.hpp:175
bool contains(const osmium::Location &location) const noexcept
Definition: box.hpp:185
constexpr bool operator==(const Box &lhs, const Box &rhs) noexcept
Definition: box.hpp:212
constexpr Location top_right() const noexcept
Definition: box.hpp:168
Box & extend(const Location &location) noexcept
Definition: box.hpp:100
double lat() const
Definition: location.hpp:414
constexpr bool valid() const noexcept
Definition: location.hpp:347
Namespace for everything in the Osmium library.
Definition: assembler.hpp:53
Box & extend(const Box &box) noexcept
Definition: box.hpp:130
osmium::Location m_top_right
Definition: box.hpp:52
constexpr bool valid() const noexcept
Definition: box.hpp:147
constexpr int32_t y() const noexcept
Definition: location.hpp:376
Location & bottom_left() noexcept
Definition: box.hpp:161
Location & set_y(const int32_t y) noexcept
Definition: location.hpp:385
Box(const osmium::Location &bottom_left, const osmium::Location &top_right)
Definition: box.hpp:82
Definition: location.hpp:273
Location & set_x(const int32_t x) noexcept
Definition: location.hpp:380
constexpr Location bottom_left() const noexcept
Definition: box.hpp:154
constexpr int32_t x() const noexcept
Definition: location.hpp:372
double size() const
Definition: box.hpp:201
constexpr Box() noexcept=default