Libosmium
2.15.4
Fast and flexible C++ library for working with OpenStreetMap data
|
Go to the documentation of this file. 1 #ifndef OSMIUM_GEOM_PROJECTION_HPP
2 #define OSMIUM_GEOM_PROJECTION_HPP
50 #ifdef ACCEPT_USE_OF_DEPRECATED_PROJ_API_H
51 # include <proj_api.h>
53 # define ACCEPT_USE_OF_DEPRECATED_PROJ_API_H
54 # include <proj_api.h>
55 # undef ACCEPT_USE_OF_DEPRECATED_PROJ_API_H
76 std::unique_ptr<void, ProjCRSDeleter>
m_crs;
80 explicit CRS(
const char* crs) :
87 explicit CRS(
const std::string& crs) :
91 explicit CRS(
int epsg) :
92 CRS(
std::string{
"+init=epsg:"} + std::to_string(epsg)) {
98 projPJ
get() const noexcept {
103 return pj_is_latlong(
m_crs.get()) != 0;
107 return pj_is_geocent(
m_crs.get()) != 0;
122 const int result = pj_transform(src.
get(), dest.
get(), 1, 1, &c.
x, &c.
y,
nullptr);
180 detail::lat_to_y(location.
lat())};
207 #endif // OSMIUM_GEOM_PROJECTION_HPP
CRS m_crs_user
Definition: projection.hpp:145
std::unique_ptr< void, ProjCRSDeleter > m_crs
Definition: projection.hpp:76
CRS(const std::string &crs)
Definition: projection.hpp:87
CRS(const char *crs)
Definition: projection.hpp:80
Definition: projection.hpp:70
int m_epsg
Definition: projection.hpp:142
Definition: projection.hpp:68
double lon() const
Definition: location.hpp:395
Projection(const char *proj_string)
Definition: projection.hpp:155
bool is_geocent() const noexcept
Definition: projection.hpp:106
double x
Definition: coordinates.hpp:50
bool is_latlong() const noexcept
Definition: projection.hpp:102
Projection(const std::string &proj_string)
Definition: projection.hpp:149
int epsg() const noexcept
Definition: projection.hpp:193
double lat() const
Definition: location.hpp:414
Namespace for everything in the Osmium library.
Definition: assembler.hpp:53
projPJ get() const noexcept
Definition: projection.hpp:98
Coordinates operator()(osmium::Location location) const
Definition: projection.hpp:173
double y
Definition: coordinates.hpp:51
constexpr double deg_to_rad(double degree) noexcept
Convert angle from degrees to radians.
Definition: util.hpp:62
Definition: coordinates.hpp:48
CRS m_crs_wgs84
Definition: projection.hpp:144
void operator()(void *crs)
Definition: projection.hpp:71
Definition: projection.hpp:140
Definition: location.hpp:271
std::string proj_string() const
Definition: projection.hpp:197
Definition: location.hpp:550
Coordinates transform(const CRS &src, const CRS &dest, Coordinates c)
Definition: projection.hpp:121
constexpr double rad_to_deg(double radians) noexcept
Convert angle from radians to degrees.
Definition: util.hpp:67
CRS(int epsg)
Definition: projection.hpp:91
std::string m_proj_string
Definition: projection.hpp:143
Projection(int epsg)
Definition: projection.hpp:161