Loading...
Searching...
No Matches
osmium::geom::Projection Class Reference

`#include <projection.hpp>`

Collaboration diagram for osmium::geom::Projection:
[legend]

## Public Member Functions

| Projection (std::string proj_string)
| Projection (const char *proj_string)
| Projection (int epsg)
Coordinates | operator() (osmium::Location location) const
int | epsg () const noexcept
std::string | proj_string () const

## Private Attributes

int | m_epsg
std::string | m_proj_string
CRS | m_crs_wgs84 {4326}
CRS | m_crs_user

## Detailed Description

Functor that does projection from WGS84 (EPSG:4326) to the given CRS.

If this Projection is initialized with the constructor taking an integer with the epsg code 4326, no projection is done. If it is initialized with epsg code 3857 the Osmium-internal implementation of the Mercator projection is used, otherwise this falls back to using the proj.4 library. Note that this "magic" does not work if you use any of the constructors taking a string.

Deprecated:
  Only supports the old PROJ API.

## Constructor & Destructor Documentation

## Projection() [1/3]

osmium::geom::Projection::Projection | ( | std::string | proj_string | ) |

inlineexplicit

## Projection() [2/3]

osmium::geom::Projection::Projection | ( | const char * | proj_string | ) |

inlineexplicit

## Projection() [3/3]

osmium::geom::Projection::Projection | ( | int | epsg | ) |

inlineexplicit

## Member Function Documentation

## epsg()

int osmium::geom::Projection::epsg | ( |  | ) | const

inlinenoexcept

## operator()()

Coordinates osmium::geom::Projection::operator() | ( | osmium::Location | location | ) | const

inline

Do coordinate transformation.

Precondition
  Location must be in valid range (depends on projection used).

## proj_string()

std::string osmium::geom::Projection::proj_string | ( |  | ) | const

inline

## Member Data Documentation

## m_crs_user

CRS osmium::geom::Projection::m_crs_user

private

## m_crs_wgs84

CRS osmium::geom::Projection::m_crs_wgs84 {4326}

private

## m_epsg

int osmium::geom::Projection::m_epsg

private

## m_proj_string

std::string osmium::geom::Projection::m_proj_string

private

The documentation for this class was generated from the following file:

- include/osmium/geom/projection.hpp