Libosmium  2.4.1
Fast and flexible C++ library for working with OpenStreetMap data
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Namespaces | Classes | Typedefs | Enumerations | Functions | Variables
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<class TProjection = IdentityProjection>
using GeoJSONFactory = GeometryFactory< osmium::geom::detail::GeoJSONFactoryImpl, TProjection >
 
template<class TProjection = IdentityProjection>
using GEOSFactory = GeometryFactory< osmium::geom::detail::GEOSFactoryImpl, TProjection >
 
template<class TProjection = IdentityProjection>
using OGRFactory = GeometryFactory< osmium::geom::detail::OGRFactoryImpl, TProjection >
 
template<class TWriter , class TProjection = IdentityProjection>
using RapidGeoJSONFactory = GeometryFactory< detail::RapidGeoJSONFactoryImpl< TWriter >, TProjection >
 
template<class TProjection = IdentityProjection>
using WKBFactory = GeometryFactory< osmium::geom::detail::WKBFactoryImpl, TProjection >
 
template<class 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)
 
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<class TProjection = IdentityProjection>
using osmium::geom::GeoJSONFactory = typedef GeometryFactory<osmium::geom::detail::GeoJSONFactoryImpl, TProjection>
template<class TProjection = IdentityProjection>
using osmium::geom::GEOSFactory = typedef GeometryFactory<osmium::geom::detail::GEOSFactoryImpl, TProjection>
template<class TProjection = IdentityProjection>
using osmium::geom::OGRFactory = typedef GeometryFactory<osmium::geom::detail::OGRFactoryImpl, TProjection>
template<class TWriter , class TProjection = IdentityProjection>
using osmium::geom::RapidGeoJSONFactory = typedef GeometryFactory<detail::RapidGeoJSONFactoryImpl<TWriter>, TProjection>
template<class TProjection = IdentityProjection>
using osmium::geom::WKBFactory = typedef GeometryFactory<osmium::geom::detail::WKBFactoryImpl, TProjection>
template<class 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)
inlinenoexcept

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 
)
inlinenoexcept
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 
)
inlinenoexcept

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)
inlinenoexcept

Convert angle from radians to degrees.

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