osmium::geom Namespace Reference

Everything related to geometry handling. More...

## Namespaces

| haversine
| Functions to calculate arc distance on Earth using the haversine formula.

## Classes

struct | Coordinates
class | CRS
class | GeometryFactory
class | IdentityProjection
class | MercatorProjection
class | Projection
struct | Tile

## Typedefs

template<typename TProjection = IdentityProjection>
using | GeoJSONFactory = GeometryFactory< osmium::geom::detail::GeoJSONFactoryImpl, TProjection >
template<typename TProjection = IdentityProjection>
using | GEOSFactory = GeometryFactory< osmium::geom::detail::GEOSFactoryImpl, TProjection >
template<typename TProjection = IdentityProjection>
using | OGRFactory = GeometryFactory< osmium::geom::detail::OGRFactoryImpl, TProjection >
template<typename TWriter , typename TProjection = IdentityProjection>
using | RapidGeoJSONFactory = GeometryFactory< detail::RapidGeoJSONFactoryImpl< TWriter >, TProjection >
template<typename TProjection = IdentityProjection>
using | WKBFactory = GeometryFactory< osmium::geom::detail::WKBFactoryImpl, TProjection >
template<typename TProjection = IdentityProjection>
using | WKTFactory = GeometryFactory< osmium::geom::detail::WKTFactoryImpl, TProjection >

## Enumerations

enum | use_nodes : bool { use_nodes::unique = true, use_nodes::all = false }
enum | direction : bool { direction::backward = true, direction::forward = false }
enum | wkb_type : bool { wkb_type::wkb = false, wkb_type::ewkb = true }
enum | out_type : bool { out_type::binary = false, out_type::hex = true }

## Functions

bool | operator== (const Coordinates &lhs, const Coordinates &rhs) noexcept
bool | operator!= (const Coordinates &lhs, const Coordinates &rhs) noexcept
template<typename TChar , typename TTraits >
std::basic_ostream< TChar, TTraits > & | operator<< (std::basic_ostream< TChar, TTraits > &out, const Coordinates &c)
Coordinates | lonlat_to_mercator (const Coordinates &c)
Coordinates | mercator_to_lonlat (const Coordinates &c)
Coordinates | transform (const CRS &src, const CRS &dest, Coordinates c)
bool | contains (const osmium::Box &a, const osmium::Box &b)
bool | operator== (const Tile &a, const Tile &b)
bool | operator!= (const Tile &a, const Tile &b)
bool | operator< (const Tile &a, const Tile &b)
constexpr double | deg_to_rad (double degree) noexcept
| Convert angle from degrees to radians. More...
constexpr double | rad_to_deg (double radians) noexcept
| Convert angle from radians to degrees. More...

## Variables

constexpr double | MERCATOR_MAX_LAT = 85.0511288
constexpr double | PI = 3.14159265358979323846

## Detailed Description

Everything related to geometry handling.

## Typedef Documentation

template<typename TProjection = IdentityProjection>

using osmium::geom::GeoJSONFactory = typedef GeometryFactory<osmium::geom::detail::GeoJSONFactoryImpl, TProjection>

template<typename TProjection = IdentityProjection>

using osmium::geom::GEOSFactory = typedef GeometryFactory<osmium::geom::detail::GEOSFactoryImpl, TProjection>

template<typename TProjection = IdentityProjection>

using osmium::geom::OGRFactory = typedef GeometryFactory<osmium::geom::detail::OGRFactoryImpl, TProjection>

template<typename TWriter , typename TProjection = IdentityProjection>

using osmium::geom::RapidGeoJSONFactory = typedef GeometryFactory<detail::RapidGeoJSONFactoryImpl<TWriter>, TProjection>

template<typename TProjection = IdentityProjection>

using osmium::geom::WKBFactory = typedef GeometryFactory<osmium::geom::detail::WKBFactoryImpl, TProjection>

template<typename TProjection = IdentityProjection>

using osmium::geom::WKTFactory = typedef GeometryFactory<osmium::geom::detail::WKTFactoryImpl, TProjection>

## Enumeration Type Documentation

enum osmium::geom::direction : bool

strong

Which direction the linestring created from a way should have.

Enumerator
backward | Linestring has reverse direction.
forward | Linestring has same direction as way.

enum osmium::geom::out_type : bool

strong

Enumerator
binary |
hex |

enum osmium::geom::use_nodes : bool

strong

Which nodes of a way to use for a linestring.

Enumerator
unique | Remove consecutive nodes with same location.
all | Use all nodes.

enum osmium::geom::wkb_type : bool

strong

Enumerator
wkb |
ewkb |

## Function Documentation

bool osmium::geom::contains | ( | const osmium::Box & | a,
|  | const osmium::Box & | b
| ) |  |

inline

Check whether one geometry contains another.

constexpr double osmium::geom::deg_to_rad | ( | double | degree | ) |

inline noexcept

Convert angle from degrees to radians.

Coordinates osmium::geom::lonlat_to_mercator | ( | const Coordinates & | c | ) |

inline

Coordinates osmium::geom::mercator_to_lonlat | ( | const Coordinates & | c | ) |

inline

bool osmium::geom::operator!= | ( | const Tile & | a,
|  | const Tile & | b
| ) |  |

inline

bool osmium::geom::operator!= | ( | const Coordinates & | lhs,
|  | const Coordinates & | rhs
| ) |  |

inline noexcept

bool osmium::geom::operator< | ( | const Tile & | a,
|  | const Tile & | b
| ) |  |

inline

This defines an arbitrary order on tiles for use in std::map etc.

template<typename TChar , typename TTraits >

std::basic_ostream<TChar, TTraits>& osmium::geom::operator<< | ( | std::basic_ostream< TChar, TTraits > & | out,
|  | const Coordinates & | c
| ) |  |

inline

bool osmium::geom::operator== | ( | const Coordinates & | lhs,
|  | const Coordinates & | rhs
| ) |  |

inline noexcept

Compare whether two Coordinates are identical. Might not give the right result if the coordinates have been the result of some calculation that introduced rounding errors.

bool osmium::geom::operator== | ( | const Tile & | a,
|  | const Tile & | b
| ) |  |

inline

constexpr double osmium::geom::rad_to_deg | ( | double | radians | ) |

inline noexcept

Convert angle from radians to degrees.

Coordinates osmium::geom::transform | ( | const CRS & | src,
|  | const CRS & | dest,
|  | Coordinates | c
| ) |  |

inline

Transform coordinates from one CRS into another. Wraps the same function of the proj library.

Coordinates have to be in radians and are produced in radians.

Exceptions

  osmmium::projection_error | if the projection fails

## Variable Documentation

constexpr double osmium::geom::MERCATOR_MAX_LAT = 85.0511288

The maximum latitude that can be projected with the Web Mercator (EPSG:3857) projection.

constexpr double osmium::geom::PI = 3.14159265358979323846