Libosmium
2.15.4
Fast and flexible C++ library for working with OpenStreetMap data
|
#include <box.hpp>
Public Member Functions | |
constexpr | Box () noexcept=default |
Box (double minx, double miny, double maxx, double maxy) | |
Box (const osmium::Location &bottom_left, const osmium::Location &top_right) | |
Box & | extend (const Location &location) noexcept |
Box & | extend (const Box &box) noexcept |
constexpr | operator bool () const noexcept |
constexpr bool | valid () const noexcept |
constexpr Location | bottom_left () const noexcept |
Location & | bottom_left () noexcept |
constexpr Location | top_right () const noexcept |
Location & | top_right () noexcept |
bool | contains (const osmium::Location &location) const noexcept |
double | size () const |
Private Attributes | |
osmium::Location | m_bottom_left {} |
osmium::Location | m_top_right {} |
Bounding box. A box is defined by two locations (bottom left location and top right location) or, alternatively by four coordinates (minx, miny, maxx, and maxy). If both locations are undefined, the box is undefined, too.
|
defaultnoexcept |
|
inline |
Create box from minimum and maximum coordinates.
|
inline |
Create box from bottom left and top right locations.
|
inlinenoexcept |
Access bottom-left location.
|
inlinenoexcept |
Access bottom-left location.
|
inlinenoexcept |
Extend this bounding box by the specified location. If the location is invalid, the bounding box is unchanged. If the box is undefined it will only contain the new location after this call.
location | The location we want to extend the box by. |
Extend this bounding box by the specified box. If the specified box is undefined, the bounding box is unchanged.
box | The box to extend by. |
|
inlineexplicitnoexcept |
Box is defined, ie. contains defined locations.
|
inline |
Calculate size of the box in square degrees.
Note that this measure isn't very useful if you want to know the real-world size of the bounding box!
osmium::invalid_location | unless all coordinates are valid. |
|
inlinenoexcept |
Access top-right location.
|
inlinenoexcept |
Access top-right location.
|
inlinenoexcept |
Box is valid, ie. defined and inside usual bounds (-180<=lon<=180, -90<=lat<=90).
|
private |
|
private |