Libosmium  2.3.0
Fast and flexible C++ library for working with OpenStreetMap data
Namespaces | Classes | Typedefs | Enumerations | Functions
osmium Namespace Reference

Namespace for everything in the Osmium library. More...

Namespaces

 area
 Code related to the building of areas (multipolygons) from relations.
 
 builder
 Classes for building OSM objects and other items in buffers.
 
 config
 
 diff_handler
 Osmium diff handlers provide access to differences between OSM object versions.
 
 experimental
 Experimental code that is not "officially" supported.
 
 geom
 Everything related to geometry handling.
 
 handler
 Osmium handlers provide callbacks for OSM objects.
 
 index
 Indexing of OSM data, Locations, etc.
 
 io
 Everything related to input and output of OSM data.
 
 memory
 Memory management of items in buffers and iterators over this data.
 
 osm_entity_bits
 Bitfield for OSM entity types.
 
 relations
 Code related to the assembly of OSM relations.
 
 tags
 Code related to working with OSM tags.
 
 thread
 Threading-related low-level code.
 
 util
 Helpful utility classes and functions not strictly OSM related.
 

Classes

struct  are_real_integers
 
class  Area
 
class  Box
 
struct  buffer_is_full
 
struct  bzip2_error
 
class  Changeset
 An OSM Changeset, a group of changes made by a single user over a short period of time. More...
 
class  CRC
 
class  DiffIterator
 
class  DiffObject
 
class  DiffObjectDerived
 
class  geometry_error
 
struct  geos_geometry_error
 
struct  gzip_error
 
class  InnerRing
 
struct  invalid_location
 
struct  io_error
 
class  Location
 
struct  location_equal
 
struct  location_less
 
class  max_op
 
class  min_op
 
class  Node
 
class  NodeRef
 
class  NodeRefList
 
struct  not_found
 
struct  object_equal_type_id
 
struct  object_equal_type_id_version
 
struct  object_order_type_id_reverse_version
 
struct  object_order_type_id_version
 
class  ObjectPointerCollection
 
class  OSMEntity
 OSMEntity is the abstract base class for the OSMObject and Changeset classes. More...
 
class  OSMObject
 
class  OuterRing
 
struct  projection_error
 
class  Relation
 
class  RelationMember
 
class  RelationMemberList
 
class  Segment
 
class  Tag
 
class  TagList
 
class  Timestamp
 
class  UndirectedSegment
 
struct  unknown_type
 
class  Way
 
class  WayNodeList
 

Typedefs

typedef DiffObjectDerived< osmium::NodeDiffNode
 
typedef DiffObjectDerived< osmium::WayDiffWay
 
typedef DiffObjectDerived< osmium::RelationDiffRelation
 
typedef int64_t object_id_type
 Type for OSM object (node, way, or relation) IDs. More...
 
typedef uint64_t unsigned_object_id_type
 Type for OSM object (node, way, or relation) IDs where we only allow positive IDs. More...
 
typedef uint32_t object_version_type
 Type for OSM object version number. More...
 
typedef uint32_t changeset_id_type
 Type for OSM changeset IDs. More...
 
typedef uint32_t user_id_type
 Type for OSM user IDs. More...
 
typedef int32_t signed_user_id_type
 Type for signed OSM user IDs. More...
 
typedef uint32_t num_changes_type
 Type for changeset num_changes. More...
 
typedef uint16_t string_size_type
 

Enumerations

enum  item_type : uint16_t {
  item_type::undefined = 0x00, item_type::node = 0x01, item_type::way = 0x02, item_type::relation = 0x03,
  item_type::area = 0x04, item_type::changeset = 0x05, item_type::tag_list = 0x11, item_type::way_node_list = 0x12,
  item_type::relation_member_list = 0x13, item_type::relation_member_list_with_full_members = 0x23, item_type::outer_ring = 0x40, item_type::inner_ring = 0x41
}
 

Functions

template<class TIterator , class... THandlers>
void apply_diff (TIterator it, TIterator end, THandlers &...handlers)
 
template<class TSource , class... THandlers>
void apply_diff (TSource &source, THandlers &...handlers)
 
template<class... THandlers>
void apply_diff (osmium::memory::Buffer &buffer, THandlers &...handlers)
 
template<class... THandlers>
void apply_diff (const osmium::memory::Buffer &buffer, THandlers &...handlers)
 
osmium::object_id_type object_id_to_area_id (osmium::object_id_type id, osmium::item_type type) noexcept
 
osmium::object_id_type area_id_to_object_id (osmium::object_id_type id) noexcept
 
OSMIUM_CONSTEXPR bool operator== (const Box &lhs, const Box &rhs) noexcept
 
template<typename TChar , typename TTraits >
std::basic_ostream< TChar, TTraits > & operator<< (std::basic_ostream< TChar, TTraits > &out, const osmium::Box &box)
 
bool operator== (const Changeset &lhs, const Changeset &rhs)
 
bool operator!= (const Changeset &lhs, const Changeset &rhs)
 
bool operator< (const Changeset &lhs, const Changeset &rhs)
 
bool operator> (const Changeset &lhs, const Changeset &rhs)
 
bool operator<= (const Changeset &lhs, const Changeset &rhs)
 
bool operator>= (const Changeset &lhs, const Changeset &rhs)
 
item_type nwr_index_to_item_type (unsigned int i) noexcept
 
unsigned int item_type_to_nwr_index (item_type type) noexcept
 
item_type char_to_item_type (const char c) noexcept
 
char item_type_to_char (const item_type type) noexcept
 
const char * item_type_to_name (const item_type type) noexcept
 
template<typename TChar , typename TTraits >
std::basic_ostream< TChar, TTraits > & operator<< (std::basic_ostream< TChar, TTraits > &out, const item_type item_type)
 
OSMIUM_CONSTEXPR bool operator== (const Location &lhs, const Location &rhs) noexcept
 
OSMIUM_CONSTEXPR bool operator!= (const Location &lhs, const Location &rhs) noexcept
 
OSMIUM_CONSTEXPR bool operator< (const Location &lhs, const Location &rhs) noexcept
 
OSMIUM_CONSTEXPR bool operator> (const Location &lhs, const Location &rhs) noexcept
 
OSMIUM_CONSTEXPR bool operator<= (const Location &lhs, const Location &rhs) noexcept
 
OSMIUM_CONSTEXPR bool operator>= (const Location &lhs, const Location &rhs) noexcept
 
template<typename TChar , typename TTraits >
std::basic_ostream< TChar, TTraits > & operator<< (std::basic_ostream< TChar, TTraits > &out, const osmium::Location &location)
 
bool operator== (const NodeRef &lhs, const NodeRef &rhs) noexcept
 
bool operator!= (const NodeRef &lhs, const NodeRef &rhs) noexcept
 
bool operator< (const NodeRef &lhs, const NodeRef &rhs) noexcept
 
bool operator> (const NodeRef &lhs, const NodeRef &rhs) noexcept
 
bool operator<= (const NodeRef &lhs, const NodeRef &rhs) noexcept
 
bool operator>= (const NodeRef &lhs, const NodeRef &rhs) noexcept
 
template<typename TChar , typename TTraits >
std::basic_ostream< TChar, TTraits > & operator<< (std::basic_ostream< TChar, TTraits > &out, const osmium::NodeRef &nr)
 
bool operator== (const OSMObject &lhs, const OSMObject &rhs) noexcept
 
bool operator!= (const OSMObject &lhs, const OSMObject &rhs) noexcept
 
bool operator< (const OSMObject &lhs, const OSMObject &rhs) noexcept
 
bool operator> (const OSMObject &lhs, const OSMObject &rhs) noexcept
 
bool operator<= (const OSMObject &lhs, const OSMObject &rhs) noexcept
 
bool operator>= (const OSMObject &lhs, const OSMObject &rhs) noexcept
 
OSMIUM_CONSTEXPR bool operator== (const Segment &lhs, const Segment &rhs) noexcept
 Segments are equal if both their locations are equal. More...
 
OSMIUM_CONSTEXPR bool operator!= (const Segment &lhs, const Segment &rhs) noexcept
 
template<typename TChar , typename TTraits >
std::basic_ostream< TChar, TTraits > & operator<< (std::basic_ostream< TChar, TTraits > &out, const osmium::Segment &segment)
 
bool operator== (const Tag &a, const Tag &b)
 
bool operator< (const Tag &a, const Tag &b)
 
template<typename TChar , typename TTraits >
std::basic_ostream< TChar, TTraits > & operator<< (std::basic_ostream< TChar, TTraits > &out, const Tag &tag)
 
OSMIUM_CONSTEXPR Timestamp start_of_time () noexcept
 
OSMIUM_CONSTEXPR Timestamp end_of_time () noexcept
 
template<typename TChar , typename TTraits >
std::basic_ostream< TChar, TTraits > & operator<< (std::basic_ostream< TChar, TTraits > &out, Timestamp timestamp)
 
template<>
osmium::Timestamp min_op_start_value< osmium::Timestamp > ()
 
template<>
osmium::Timestamp max_op_start_value< osmium::Timestamp > ()
 
object_id_type string_to_object_id (const char *input)
 
std::pair< osmium::item_type, osmium::object_id_typestring_to_object_id (const char *input, osmium::osm_entity_bits::type types)
 
object_version_type string_to_object_version (const char *input)
 
changeset_id_type string_to_changeset_id (const char *input)
 
signed_user_id_type string_to_user_id (const char *input)
 
num_changes_type string_to_num_changes (const char *input)
 
bool operator< (const UndirectedSegment &lhs, const UndirectedSegment &rhs) noexcept
 
bool operator> (const UndirectedSegment &lhs, const UndirectedSegment &rhs) noexcept
 
bool operator<= (const UndirectedSegment &lhs, const UndirectedSegment &rhs) noexcept
 
bool operator>= (const UndirectedSegment &lhs, const UndirectedSegment &rhs) noexcept
 
template<typename TChar , typename TTraits >
std::basic_ostream< TChar, TTraits > & operator<< (std::basic_ostream< TChar, TTraits > &out, const osmium::UndirectedSegment &segment)
 
template<typename T , typename F , typename std::enable_if< are_real_integers< T, F >::value &&std::is_same< T, F >::value, int >::type = 0>
static_cast_with_assert (const F value)
 
template<typename T , typename F >
static_cast_with_assert (const F value)
 
template<typename T >
min_op_start_value ()
 
template<typename T >
max_op_start_value ()
 
std::vector< std::string > split_string (const std::string &str, const char sep, bool compact=false)
 
std::vector< std::string > split_string (const std::string &str, const char *sep, bool compact=false)
 
template<class... THandlers>
void apply_item (const osmium::memory::Item &item, THandlers &...handlers)
 
template<class... THandlers>
void apply_item (osmium::memory::Item &item, THandlers &...handlers)
 
template<class TIterator , class... THandlers>
void apply (TIterator it, TIterator end, THandlers &...handlers)
 
template<class TContainer , class... THandlers>
void apply (TContainer &c, THandlers &...handlers)
 
template<class... THandlers>
void apply (const osmium::memory::Buffer &buffer, THandlers &...handlers)
 

Detailed Description

Namespace for everything in the Osmium library.

Typedef Documentation

typedef uint32_t osmium::changeset_id_type

Type for OSM changeset IDs.

typedef uint32_t osmium::num_changes_type

Type for changeset num_changes.

typedef int64_t osmium::object_id_type

Type for OSM object (node, way, or relation) IDs.

typedef uint32_t osmium::object_version_type

Type for OSM object version number.

typedef int32_t osmium::signed_user_id_type

Type for signed OSM user IDs.

typedef uint16_t osmium::string_size_type

Size for strings in OSM data such as user names, tag keys, roles, etc. In Osmium they can be up to 2^16 bytes long, but OSM usually has lower defined limits.

Type for OSM object (node, way, or relation) IDs where we only allow positive IDs.

typedef uint32_t osmium::user_id_type

Type for OSM user IDs.

Enumeration Type Documentation

enum osmium::item_type : uint16_t
strong
Enumerator
undefined 
node 
way 
relation 
area 
changeset 
tag_list 
way_node_list 
relation_member_list 
relation_member_list_with_full_members 
outer_ring 
inner_ring 

Function Documentation

template<class TIterator , class... THandlers>
void osmium::apply ( TIterator  it,
TIterator  end,
THandlers &...  handlers 
)
inline
template<class TContainer , class... THandlers>
void osmium::apply ( TContainer &  c,
THandlers &...  handlers 
)
inline
template<class... THandlers>
void osmium::apply ( const osmium::memory::Buffer buffer,
THandlers &...  handlers 
)
inline
template<class TIterator , class... THandlers>
void osmium::apply_diff ( TIterator  it,
TIterator  end,
THandlers &...  handlers 
)
inline
template<class TSource , class... THandlers>
void osmium::apply_diff ( TSource &  source,
THandlers &...  handlers 
)
inline
template<class... THandlers>
void osmium::apply_diff ( osmium::memory::Buffer buffer,
THandlers &...  handlers 
)
inline
template<class... THandlers>
void osmium::apply_diff ( const osmium::memory::Buffer buffer,
THandlers &...  handlers 
)
inline
template<class... THandlers>
void osmium::apply_item ( const osmium::memory::Item item,
THandlers &...  handlers 
)
inline
template<class... THandlers>
void osmium::apply_item ( osmium::memory::Item item,
THandlers &...  handlers 
)
inline
osmium::object_id_type osmium::area_id_to_object_id ( osmium::object_id_type  id)
inlinenoexcept

Convert area id into id of the way or relation it was created from.

Parameters
idArea id
Returns
Way or Relation id.
item_type osmium::char_to_item_type ( const char  c)
inlinenoexcept
OSMIUM_CONSTEXPR Timestamp osmium::end_of_time ( )
inlinenoexcept
char osmium::item_type_to_char ( const item_type  type)
inlinenoexcept
const char* osmium::item_type_to_name ( const item_type  type)
inlinenoexcept
unsigned int osmium::item_type_to_nwr_index ( item_type  type)
inlinenoexcept

Return index for item_type: node -> 0, way -> 1, relation -> 2

template<typename T >
T osmium::max_op_start_value ( )
inline
template<typename T >
T osmium::min_op_start_value ( )
inline
item_type osmium::nwr_index_to_item_type ( unsigned int  i)
inlinenoexcept

Return item_type for index: 0 -> node, 1 -> way, 2 -> relation

osmium::object_id_type osmium::object_id_to_area_id ( osmium::object_id_type  id,
osmium::item_type  type 
)
inlinenoexcept

Convert way or (multipolygon) relation id into unique area id.

Parameters
idId of a way or relation
typeType of object (way or relation)
Returns
Area id
OSMIUM_CONSTEXPR bool osmium::operator!= ( const Segment lhs,
const Segment rhs 
)
inlinenoexcept
bool osmium::operator!= ( const NodeRef lhs,
const NodeRef rhs 
)
inlinenoexcept
OSMIUM_CONSTEXPR bool osmium::operator!= ( const Location lhs,
const Location rhs 
)
inlinenoexcept
bool osmium::operator!= ( const Changeset lhs,
const Changeset rhs 
)
inline
bool osmium::operator!= ( const OSMObject lhs,
const OSMObject rhs 
)
inlinenoexcept
bool osmium::operator< ( const UndirectedSegment lhs,
const UndirectedSegment rhs 
)
inlinenoexcept

UndirectedSegments are "smaller" if they are to the left and down of another segment. The first() location is checked first() and only if they have the same first() location the second() location is taken into account.

bool osmium::operator< ( const Tag a,
const Tag b 
)
inline
bool osmium::operator< ( const NodeRef lhs,
const NodeRef rhs 
)
inlinenoexcept
OSMIUM_CONSTEXPR bool osmium::operator< ( const Location lhs,
const Location rhs 
)
inlinenoexcept

Compare two locations by comparing first the x and then the y coordinate. If either of the locations is undefined the result is undefined.

bool osmium::operator< ( const Changeset lhs,
const Changeset rhs 
)
inline

Changesets can be ordered by id.

bool osmium::operator< ( const OSMObject lhs,
const OSMObject rhs 
)
inlinenoexcept

OSMObjects can be ordered by type, id and version. Note that we use the absolute value of the id for a better ordering of objects with negative id.

template<typename TChar , typename TTraits >
std::basic_ostream<TChar, TTraits>& osmium::operator<< ( std::basic_ostream< TChar, TTraits > &  out,
const osmium::UndirectedSegment segment 
)
inline

Output UndirectedSegment to a stream.

template<typename TChar , typename TTraits >
std::basic_ostream<TChar, TTraits>& osmium::operator<< ( std::basic_ostream< TChar, TTraits > &  out,
const osmium::Segment segment 
)
inline

Output Segment to a stream.

template<typename TChar , typename TTraits >
std::basic_ostream<TChar, TTraits>& osmium::operator<< ( std::basic_ostream< TChar, TTraits > &  out,
const Tag tag 
)
inline

Output a Tag to a stream.

template<typename TChar , typename TTraits >
std::basic_ostream<TChar, TTraits>& osmium::operator<< ( std::basic_ostream< TChar, TTraits > &  out,
const osmium::NodeRef nr 
)
inline

Output a NodeRef to a stream.

template<typename TChar , typename TTraits >
std::basic_ostream<TChar, TTraits>& osmium::operator<< ( std::basic_ostream< TChar, TTraits > &  out,
const item_type  item_type 
)
inline
template<typename TChar , typename TTraits >
std::basic_ostream<TChar, TTraits>& osmium::operator<< ( std::basic_ostream< TChar, TTraits > &  out,
Timestamp  timestamp 
)
inline
template<typename TChar , typename TTraits >
std::basic_ostream<TChar, TTraits>& osmium::operator<< ( std::basic_ostream< TChar, TTraits > &  out,
const osmium::Box box 
)
inline

Output a box to a stream. The format is "(LON, LAT, LON, LAT)" or "(undefined)" if the box is undefined.

Returns
Reference to basic_ostream given as first parameter.
template<typename TChar , typename TTraits >
std::basic_ostream<TChar, TTraits>& osmium::operator<< ( std::basic_ostream< TChar, TTraits > &  out,
const osmium::Location location 
)
inline

Output a location to a stream.

bool osmium::operator<= ( const UndirectedSegment lhs,
const UndirectedSegment rhs 
)
inlinenoexcept
bool osmium::operator<= ( const NodeRef lhs,
const NodeRef rhs 
)
inlinenoexcept
OSMIUM_CONSTEXPR bool osmium::operator<= ( const Location lhs,
const Location rhs 
)
inlinenoexcept
bool osmium::operator<= ( const Changeset lhs,
const Changeset rhs 
)
inline
bool osmium::operator<= ( const OSMObject lhs,
const OSMObject rhs 
)
inlinenoexcept
OSMIUM_CONSTEXPR bool osmium::operator== ( const Segment lhs,
const Segment rhs 
)
inlinenoexcept

Segments are equal if both their locations are equal.

bool osmium::operator== ( const Tag a,
const Tag b 
)
inline
bool osmium::operator== ( const NodeRef lhs,
const NodeRef rhs 
)
inlinenoexcept
OSMIUM_CONSTEXPR bool osmium::operator== ( const Box lhs,
const Box rhs 
)
inlinenoexcept

Boxes are equal if both locations are equal. Undefined boxes will compare equal.

OSMIUM_CONSTEXPR bool osmium::operator== ( const Location lhs,
const Location rhs 
)
inlinenoexcept

Locations are equal if both coordinates are equal.

bool osmium::operator== ( const Changeset lhs,
const Changeset rhs 
)
inline

Changesets are equal if their IDs are equal.

bool osmium::operator== ( const OSMObject lhs,
const OSMObject rhs 
)
inlinenoexcept

OSMObjects are equal if their type, id, and version are equal.

bool osmium::operator> ( const UndirectedSegment lhs,
const UndirectedSegment rhs 
)
inlinenoexcept
bool osmium::operator> ( const NodeRef lhs,
const NodeRef rhs 
)
inlinenoexcept
OSMIUM_CONSTEXPR bool osmium::operator> ( const Location lhs,
const Location rhs 
)
inlinenoexcept
bool osmium::operator> ( const Changeset lhs,
const Changeset rhs 
)
inline
bool osmium::operator> ( const OSMObject lhs,
const OSMObject rhs 
)
inlinenoexcept
bool osmium::operator>= ( const UndirectedSegment lhs,
const UndirectedSegment rhs 
)
inlinenoexcept
bool osmium::operator>= ( const NodeRef lhs,
const NodeRef rhs 
)
inlinenoexcept
OSMIUM_CONSTEXPR bool osmium::operator>= ( const Location lhs,
const Location rhs 
)
inlinenoexcept
bool osmium::operator>= ( const Changeset lhs,
const Changeset rhs 
)
inline
bool osmium::operator>= ( const OSMObject lhs,
const OSMObject rhs 
)
inlinenoexcept
std::vector<std::string> osmium::split_string ( const std::string &  str,
const char  sep,
bool  compact = false 
)
inline

Split string on the separator character.

Parameters
strThe string to be split.
sepThe separator character.
compactSet this to true to remove empty strings from result
Returns
Vector with the parts of the string split up.
std::vector<std::string> osmium::split_string ( const std::string &  str,
const char *  sep,
bool  compact = false 
)
inline

Split string on the separator character(s).

Parameters
strThe string to be split.
sepThe separator character(s).
compactSet this to true to remove empty strings from result
Returns
Vector with the parts of the string split up.
OSMIUM_CONSTEXPR Timestamp osmium::start_of_time ( )
inlinenoexcept
template<typename T , typename F , typename std::enable_if< are_real_integers< T, F >::value &&std::is_same< T, F >::value, int >::type = 0>
T osmium::static_cast_with_assert ( const F  value)
inline
template<typename T , typename F >
T osmium::static_cast_with_assert ( const F  value)
inline
changeset_id_type osmium::string_to_changeset_id ( const char *  input)
inline
num_changes_type osmium::string_to_num_changes ( const char *  input)
inline
object_id_type osmium::string_to_object_id ( const char *  input)
inline
std::pair<osmium::item_type, osmium::object_id_type> osmium::string_to_object_id ( const char *  input,
osmium::osm_entity_bits::type  types 
)
inline
object_version_type osmium::string_to_object_version ( const char *  input)
inline
signed_user_id_type osmium::string_to_user_id ( const char *  input)
inline