Libosmium
2.11.1
Fast and flexible C++ library for working with OpenStreetMap data
|
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 | |
Bit field 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. | |
Typedefs | |
using | DiffNode = DiffObjectDerived< osmium::Node > |
using | DiffWay = DiffObjectDerived< osmium::Way > |
using | DiffRelation = DiffObjectDerived< osmium::Relation > |
using | object_id_type = int64_t |
Type for OSM object (node, way, or relation) IDs. More... | |
using | unsigned_object_id_type = uint64_t |
Type for OSM object (node, way, or relation) IDs where we only allow positive IDs. More... | |
using | object_version_type = uint32_t |
Type for OSM object version number. More... | |
using | changeset_id_type = uint32_t |
Type for OSM changeset IDs. More... | |
using | user_id_type = uint32_t |
Type for OSM user IDs. More... | |
using | signed_user_id_type = int32_t |
Type for signed OSM user IDs. More... | |
using | num_changes_type = uint32_t |
Type for changeset num_changes. More... | |
using | num_comments_type = uint32_t |
Type for changeset num_comments. More... | |
using | string_size_type = uint16_t |
Enumerations | |
enum | diff_indicator_type { diff_indicator_type::none = 0, diff_indicator_type::left = 1, diff_indicator_type::right = 2, diff_indicator_type::both = 3 } |
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, item_type::changeset_discussion = 0x80 } |
Functions | |
constexpr | _timestamp (const osmium::Timestamp &value) noexcept |
constexpr | _timestamp (time_t value) noexcept |
constexpr | _timestamp (uint32_t value) noexcept |
_timestamp (const char *value) | |
_timestamp (const std::string &value) | |
template<typename TBasicIterator > | |
DiffIterator< TBasicIterator > | make_diff_iterator (TBasicIterator begin, TBasicIterator end) |
template<typename TIterator , typename... THandlers> | |
void | apply_diff (TIterator it, TIterator end, THandlers &...handlers) |
template<typename TSource , typename... THandlers> | |
void | apply_diff (TSource &source, THandlers &...handlers) |
template<typename... THandlers> | |
void | apply_diff (osmium::memory::Buffer &buffer, THandlers &...handlers) |
template<typename... THandlers> | |
void | apply_diff (const osmium::memory::Buffer &buffer, THandlers &...handlers) |
bool | opl_parse (const char *data, osmium::memory::Buffer &buffer) |
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 |
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) |
constexpr bool | operator== (const Location &lhs, const Location &rhs) noexcept |
constexpr bool | operator!= (const Location &lhs, const Location &rhs) noexcept |
constexpr bool | operator< (const Location &lhs, const Location &rhs) noexcept |
constexpr bool | operator> (const Location &lhs, const Location &rhs) noexcept |
constexpr bool | operator<= (const Location &lhs, const Location &rhs) noexcept |
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) |
constexpr bool | operator== (const NodeRef &lhs, const NodeRef &rhs) noexcept |
constexpr bool | operator!= (const NodeRef &lhs, const NodeRef &rhs) noexcept |
constexpr bool | operator< (const NodeRef &lhs, const NodeRef &rhs) noexcept |
constexpr bool | operator> (const NodeRef &lhs, const NodeRef &rhs) noexcept |
constexpr bool | operator<= (const NodeRef &lhs, const NodeRef &rhs) noexcept |
constexpr 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 |
constexpr bool | operator== (const Segment &lhs, const Segment &rhs) noexcept |
Segments are equal if both their locations are equal. More... | |
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 &lhs, const Tag &rhs) |
bool | operator< (const Tag &lhs, const Tag &rhs) |
template<typename TChar , typename TTraits > | |
std::basic_ostream< TChar, TTraits > & | operator<< (std::basic_ostream< TChar, TTraits > &out, const Tag &tag) |
constexpr Timestamp | start_of_time () noexcept |
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) |
bool | operator== (const Timestamp &lhs, const Timestamp &rhs) noexcept |
bool | operator!= (const Timestamp &lhs, const Timestamp &rhs) noexcept |
bool | operator< (const Timestamp &lhs, const Timestamp &rhs) noexcept |
bool | operator> (const Timestamp &lhs, const Timestamp &rhs) noexcept |
bool | operator<= (const Timestamp &lhs, const Timestamp &rhs) noexcept |
bool | operator>= (const Timestamp &lhs, const Timestamp &rhs) noexcept |
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_type > | string_to_object_id (const char *input, osmium::osm_entity_bits::type types, osmium::item_type default_type=osmium::item_type::undefined) |
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) |
num_comments_type | string_to_num_comments (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> | |
T | static_cast_with_assert (const F value) |
template<typename T , typename F > | |
T | static_cast_with_assert (const F value) |
template<typename P , typename It = typename P::first_type> | |
iterator_range< It > | make_range (P &&p) |
template<typename T > | |
T | min_op_start_value () |
template<typename T > | |
T | max_op_start_value () |
template<typename... Ts> | |
std::tuple< const Ts &...> | const_tie (const Ts &...args) noexcept |
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<typename TItem , typename... THandlers> | |
void | apply_item (TItem &item, THandlers &&...handlers) |
template<typename... THandlers> | |
void | apply_flush (THandlers &&...handlers) |
template<typename TIterator , typename... THandlers> | |
void | apply (TIterator it, TIterator end, THandlers &&...handlers) |
template<typename TContainer , typename... THandlers> | |
void | apply (TContainer &c, THandlers &&...handlers) |
template<typename... THandlers> | |
void | apply (const osmium::memory::Buffer &buffer, THandlers &&...handlers) |
Variables | |
constexpr const int | max_osm_string_length = 256 * 4 |
Namespace for everything in the Osmium library.
using osmium::changeset_id_type = typedef uint32_t |
Type for OSM changeset IDs.
using osmium::DiffNode = typedef DiffObjectDerived<osmium::Node> |
using osmium::DiffRelation = typedef DiffObjectDerived<osmium::Relation> |
using osmium::DiffWay = typedef DiffObjectDerived<osmium::Way> |
using osmium::num_changes_type = typedef uint32_t |
Type for changeset num_changes.
using osmium::num_comments_type = typedef uint32_t |
Type for changeset num_comments.
using osmium::object_id_type = typedef int64_t |
Type for OSM object (node, way, or relation) IDs.
using osmium::object_version_type = typedef uint32_t |
Type for OSM object version number.
using osmium::signed_user_id_type = typedef int32_t |
Type for signed OSM user IDs.
using osmium::string_size_type = typedef uint16_t |
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.
using osmium::unsigned_object_id_type = typedef uint64_t |
Type for OSM object (node, way, or relation) IDs where we only allow positive IDs.
using osmium::user_id_type = typedef uint32_t |
Type for OSM user IDs.
|
strong |
|
strong |
|
explicitnoexcept |
|
explicitnoexcept |
|
explicitnoexcept |
|
explicit |
|
explicit |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
Like std::tie(), but takes its arguments as const references. Used as a helper function when sorting.
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
Return index for item_type: node -> 0, way -> 1, relation -> 2
type | Item type. Must be node, way, or relation. |
|
inline |
Create a DiffIterator based on the given iterators.
|
inline |
Helper function to create iterator_range from std::pair.
|
inline |
|
inline |
|
inline |
|
inline |
|
inlinenoexcept |
Return item_type for index: 0 -> node, 1 -> way, 2 -> relation
i | Index. Must be between 0 and 2. |
|
inlinenoexcept |
Convert way or (multipolygon) relation id into unique area id.
id | Id of a way or relation |
type | Type of object (way or relation) |
|
inlinenoexcept |
|
inlinenoexcept |
Compare two NodeRefs. They are not equal if they reference different Node IDs.
|
inlinenoexcept |
|
inline |
|
inlinenoexcept |
|
inlinenoexcept |
|
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.
|
inline |
|
inlinenoexcept |
Compare two NodeRefs. NodeRefs are ordered according to the Node ID they reference.
|
inlinenoexcept |
|
inline |
Changesets can be ordered by id.
|
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.
|
inlinenoexcept |
OSMObjects can be ordered by type, id, version, and timestamp. Usually ordering by timestamp is not necessary as there shouldn't be two objects with the same type, id, and version. But this can happen when creating diff files from extracts, so we take the timestamp into account here.
Note that we use the absolute value of the id for a better ordering of objects with negative id. If the IDs have the same absolute value, the positive ID comes first.
See object_order_type_id_reverse_version if you need a different ordering.
|
inline |
Output UndirectedSegment to a stream.
|
inline |
Output Segment to a stream.
|
inline |
Output a Tag to a stream.
|
inline |
|
inline |
Output a NodeRef to a stream.
|
inline |
Output a box to a stream. The format is "(LON, LAT, LON, LAT)" or "(undefined)" if the box is undefined.
|
inline |
|
inline |
Output a location to a stream.
|
inlinenoexcept |
|
inlinenoexcept |
Compare two NodeRefs. NodeRefs are ordered according to the Node ID they reference.
|
inlinenoexcept |
|
inline |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
Segments are equal if both their locations are equal.
|
inline |
|
inlinenoexcept |
Compare two NodeRefs. They are equal if they reference the same Node ID.
|
inlinenoexcept |
Boxes are equal if both locations are equal. Undefined boxes will compare equal.
|
inlinenoexcept |
|
inline |
Changesets are equal if their IDs are equal.
|
inlinenoexcept |
OSMObjects are equal if their type, id, and version are equal.
|
inlinenoexcept |
Locations are equal if both coordinates are equal.
|
inlinenoexcept |
|
inlinenoexcept |
Compare two NodeRefs. NodeRefs are ordered according to the Node ID they reference.
|
inlinenoexcept |
|
inline |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
Compare two NodeRefs. NodeRefs are ordered according to the Node ID they reference.
|
inlinenoexcept |
|
inline |
|
inlinenoexcept |
|
inlinenoexcept |
|
inline |
Parses one line in OPL format. The line must not have a newline character at the end. Buffer.commit() is called automatically if the write succeeded.
data | Line must be in this zero-delimited string. |
buffer | Result will be written to this buffer. |
osmium::opl_error | If the parsing fails. |
|
inline |
Split string on the separator character.
str | The string to be split. |
sep | The separator character. |
compact | Set this to true to remove empty strings from result |
|
inline |
Split string on the separator character(s).
str | The string to be split. |
sep | The separator character(s). |
compact | Set this to true to remove empty strings from result |
|
inlinenoexcept |
|
inline |
|
inline |
|
inline |
Convert string with changeset id to changeset_id_type.
input | Input string. |
std::range_error | if the value is out of range. |
|
inline |
Convert string with number of changes to num_changes_type.
input | Input string. |
std::range_error | if the value is out of range. |
|
inline |
Convert string with number of comments to num_comments_type.
input | Input string. |
std::range_error | if the value is out of range. |
|
inline |
Convert string with object id to object_id_type.
input | Input string. |
std::range_error | if the value is out of range. |
|
inline |
Parse string with object type identifier followed by object id. This reads strings like "n1234" and "w10". If there is no type prefix, the default_type is returned.
input | Input string. |
types | Allowed types. Must not be osmium::osm_entity_bits::nothing. |
default_type | Type used when there is no type prefix. |
std::range_error | if the value is out of range. |
|
inline |
Convert string with object version to object_version_type.
input | Input string. |
std::range_error | if the value is out of range. |
|
inline |
Convert string with user id to signed_user_id_type.
input | Input string. |
std::range_error | if the value is out of range. |
constexpr const int osmium::max_osm_string_length = 256 * 4 |