1 #ifndef OSMIUM_GEOM_PROJECTION_HPP 2 #define OSMIUM_GEOM_PROJECTION_HPP 70 std::unique_ptr<void, ProjCRSDeleter>
m_crs;
74 explicit CRS(
const char* crs) :
81 explicit CRS(
const std::string& crs) :
85 explicit CRS(
int epsg) :
86 CRS(
std::string{
"+init=epsg:"} + std::to_string(epsg)) {
92 projPJ
get() const noexcept {
97 return pj_is_latlong(
m_crs.get()) != 0;
101 return pj_is_geocent(
m_crs.get()) != 0;
116 const int result = pj_transform(src.
get(), dest.
get(), 1, 1, &c.
x, &c.
y,
nullptr);
168 detail::lat_to_y(location.
lat())};
195 #endif // OSMIUM_GEOM_PROJECTION_HPP double y
Definition: coordinates.hpp:51
projPJ get() const noexcept
Definition: projection.hpp:92
double lon() const
Definition: location.hpp:395
std::string proj_string() const
Definition: projection.hpp:185
bool is_latlong() const noexcept
Definition: projection.hpp:96
Definition: projection.hpp:64
CRS m_crs_wgs84
Definition: projection.hpp:138
double lat() const
Definition: location.hpp:414
Definition: location.hpp:550
CRS(int epsg)
Definition: projection.hpp:85
bool is_geocent() const noexcept
Definition: projection.hpp:100
Projection(int epsg)
Definition: projection.hpp:155
CRS(const std::string &crs)
Definition: projection.hpp:81
Coordinates transform(const CRS &src, const CRS &dest, Coordinates c)
Definition: projection.hpp:115
Namespace for everything in the Osmium library.
Definition: assembler.hpp:53
constexpr double deg_to_rad(double degree) noexcept
Convert angle from degrees to radians.
Definition: util.hpp:62
std::string m_proj_string
Definition: projection.hpp:137
Definition: coordinates.hpp:48
CRS m_crs_user
Definition: projection.hpp:139
std::unique_ptr< void, ProjCRSDeleter > m_crs
Definition: projection.hpp:70
CRS(const char *crs)
Definition: projection.hpp:74
Definition: projection.hpp:134
Definition: location.hpp:271
int m_epsg
Definition: projection.hpp:136
void operator()(void *crs)
Definition: projection.hpp:65
Definition: projection.hpp:62
Projection(const std::string &proj_string)
Definition: projection.hpp:143
Projection(const char *proj_string)
Definition: projection.hpp:149
int epsg() const noexcept
Definition: projection.hpp:181
double x
Definition: coordinates.hpp:50
Coordinates operator()(osmium::Location location) const
Definition: projection.hpp:161
constexpr double rad_to_deg(double radians) noexcept
Convert angle from radians to degrees.
Definition: util.hpp:67