|
Libosmium
Fast and flexible C++ library for working with OpenStreetMap data
|
#include <coordinates.hpp>
Public Member Functions | |
| Coordinates () noexcept | |
| Coordinates (double cx, double cy) noexcept | |
| Coordinates (const osmium::Location &location) | |
| bool | valid () const noexcept |
| void | append_to_string (std::string &s, const char infix, int precision) const |
| void | append_to_string (std::string &s, const char prefix, const char infix, const char suffix, int precision) const |
Public Attributes | |
| double | x |
| double | y |
|
inlinenoexcept |
Default constructor creates invalid coordinates.
|
inlineexplicitnoexcept |
Create Coordinates from doubles. If any of them is NaN, the coordinates are invalid.
|
inline |
Create Coordinates from a Location. Will throw osmium::invalid_location if the location is not valid.
This constructor is not explicit on purpose allowing use of a Location everywhere a Coordinates object is needed.
|
inline |
Convert coordinates to text and append to given string. If the coordinate is invalid, the fixed string "invalid" will be added to the string.
| s | String to append the coordinates to. |
| infix | Character to print between the two coordinates. |
| precision | Number of digits after the decimal point the coordinate will be rounded to. |
|
inline |
Convert coordinates to text and append to given string. If the coordinate is invalid, the fixed string "invalid" will be added to the string between the prefix and suffix characters.
| s | String to append the coordinates to. |
| prefix | Character to print before the first coordinate. |
| infix | Character to print between the two coordinates. |
| suffix | Character to print after the second coordinate. |
| precision | Number of digits after the decimal point the coordinate will be rounded to. |
|
inlinenoexcept |
Coordinates are invalid if they have been default constructed.
| double osmium::geom::Coordinates::x |
| double osmium::geom::Coordinates::y |