OSM

OSM Namespace Reference

Namespaces

 XmlWriter
 

Classes

class  BoundingBox
 
class  Coordinate
 
class  DataSet
 
class  DataSetMergeBuffer
 
class  Element
 
class  Member
 
class  Node
 
class  O5mParser
 
class  OsmPbfParser
 
class  OverpassQuery
 
class  OverpassQueryManager
 
class  Relation
 
class  Role
 
class  StringKey
 
class  Tag
 
class  TagKey
 
class  UniqueElement
 
class  Way
 
class  ZTile
 

Typedefs

typedef int64_t Id
 

Enumerations

enum  ForeachFlag : uint8_t { IncludeRelations = 1, IncludeWays = 2, IncludeNodes = 4, IterateAll = IncludeRelations | IncludeWays | IncludeNodes }
 
enum  Type : uint8_t { Null, Node, Way, Relation }
 

Functions

template<typename Iter >
static void appendNodesFromWay (const DataSet &dataSet, std::vector< const Node * > &nodes, const Iter &nodeBegin, const Iter &nodeEnd)
 
KOSM_EXPORT void assemblePath (const DataSet &dataSet, std::vector< const Way * > &&ways, std::vector< const Node * > &path)
 
KOSM_EXPORT void assemblePath (const DataSet &dataSet, const std::vector< OSM::Element > &ways, std::vector< const Node * > &path)
 
constexpr Element coalesce (Element e)
 
template<typename... Args>
constexpr Element coalesce (Element e, Args...args)
 
constexpr bool contains (BoundingBox bbox, Coordinate coord)
 
KOSM_EXPORT UniqueElement copy_element (Element e)
 
constexpr double degToRad (double deg)
 
KOSM_EXPORT double distance (double lat1, double lon1, double lat2, double lon2)
 
KOSM_EXPORT double distance (Coordinate coord1, Coordinate coord2)
 
double distance (Coordinate l1, Coordinate l2, Coordinate p)
 
KOSM_EXPORT double distance (const std::vector< const OSM::Node * > &path, Coordinate coord)
 
template<typename Func >
void for_each (const DataSet &dataSet, Func func, uint8_t flags=IterateAll)
 
template<typename Func >
void for_each_member (const DataSet &dataSet, const Relation &rel, Func func)
 
template<typename Func >
void for_each_node (const DataSet &dataSet, const Way &way, Func func)
 
constexpr bool intersects (BoundingBox bbox1, BoundingBox bbox2)
 
constexpr uint32_t latitudeDistance (BoundingBox bbox1, BoundingBox bbox2)
 
constexpr uint32_t longitudeDifference (BoundingBox bbox1, BoundingBox bbox2)
 
constexpr bool operator< (const Tag &lhs, TagKey rhs)
 
constexpr bool operator< (TagKey lhs, const Tag &rhs)
 
template<typename Elem >
bool operator< (const Elem &elem, Id id)
 
constexpr double radToDeg (double rad)
 
template<typename Elem >
void removeTag (Elem &elem, TagKey key)
 
template<typename Elem >
void setTag (Elem &elem, Tag &&tag)
 
template<typename Elem >
void setTagValue (Elem &elem, TagKey key, const QByteArray &value)
 
template<typename Elem >
QByteArray tagValue (const Elem &elem, TagKey key)
 
template<typename Elem >
QByteArray tagValue (const Elem &elem, const char *keyName)
 
template<typename Elem >
QByteArray tagValue (const Elem &elem, const char *keyName, const QLocale &locale)
 
constexpr BoundingBox unite (BoundingBox bbox1, BoundingBox bbox2)
 
ZTile ztileFromBoundingBox (BoundingBox bbox)
 

Detailed Description

Low-level types and functions to work with raw OSM data as efficiently as possible.

Typedef Documentation

typedef int64_t OSM::Id

OSM element identifier.

Definition at line 26 of file datatypes.h.

Enumeration Type Documentation

enum OSM::Type : uint8_t
strong

Element type.

Definition at line 247 of file datatypes.h.

Function Documentation

template<typename Iter >
static void OSM::appendNodesFromWay ( const DataSet dataSet,
std::vector< const Node * > &  nodes,
const Iter &  nodeBegin,
const Iter &  nodeEnd 
)
static

Appends the nodes referenced by nodesBegin and into nodes.

This would typically be iterators on OSM::Way::nodes.

Definition at line 24 of file pathutil.h.

void OSM::assemblePath ( const DataSet dataSet,
std::vector< const Way * > &&  ways,
std::vector< const Node * > &  path 
)

Assemble a continuous path into path from the given ways.

Definition at line 42 of file pathutil.cpp.

constexpr Element OSM::coalesce ( Element  e)

Utility function similar to SQL COALESCE for OSM::Element, ie.

this returns the first non-null element passed as argument.

Definition at line 138 of file element.h.

UniqueElement OSM::copy_element ( Element  e)

Creates a copy of element.

Definition at line 300 of file element.cpp.

constexpr double OSM::degToRad ( double  deg)
inline

Degree to radian conversion.

Definition at line 19 of file geomath.h.

double OSM::distance ( double  lat1,
double  lon1,
double  lat2,
double  lon2 
)

Distance between two coordinates.

Definition at line 17 of file geomath.cpp.

double OSM::distance ( Coordinate  coord1,
Coordinate  coord2 
)

Distance between coord1 and coord2 in meter.

Definition at line 28 of file geomath.cpp.

double OSM::distance ( OSM::Coordinate  l1,
OSM::Coordinate  l2,
OSM::Coordinate  p 
)

Distance in meters between a line segment defined by l1 and l2 to a point p.

Definition at line 33 of file geomath.cpp.

double OSM::distance ( const std::vector< const OSM::Node * > &  path,
OSM::Coordinate  coord 
)

Distance between the given polygon and coordinate, in meter.

Definition at line 48 of file geomath.cpp.

constexpr double OSM::radToDeg ( double  rad)
inline

Radian to degree conversion.

Definition at line 24 of file geomath.h.

template<typename Elem >
void OSM::removeTag ( Elem &  elem,
TagKey  key 
)
inline

Removes a tag from the given element.

Definition at line 470 of file datatypes.h.

template<typename Elem >
void OSM::setTag ( Elem &  elem,
Tag &&  tag 
)
inline

Inserts a new tag, or replaces an existing one with the same key.

Definition at line 450 of file datatypes.h.

template<typename Elem >
void OSM::setTagValue ( Elem &  elem,
TagKey  key,
const QByteArray value 
)
inline

Inserts a new tag, or updates an existing one.

Definition at line 462 of file datatypes.h.

template<typename Elem >
QByteArray OSM::tagValue ( const Elem &  elem,
TagKey  key 
)
inline

Returns the tag value for key of elem.

Definition at line 382 of file datatypes.h.

template<typename Elem >
QByteArray OSM::tagValue ( const Elem &  elem,
const char *  keyName 
)
inline

Returns the tag value for key name keyName of elem.

Warning
This is slow due to doing a linear search and string comparissons. Where possible avoid this in favor of tagValue().

Definition at line 396 of file datatypes.h.

template<typename Elem >
QByteArray OSM::tagValue ( const Elem &  elem,
const char *  keyName,
const QLocale locale 
)
inline

Returns the localized version of the tag value for key name keyName of elem.

Warning
This is slow due to doing a linear search and string comparissons.

Definition at line 409 of file datatypes.h.

ZTile OSM::ztileFromBoundingBox ( OSM::BoundingBox  bbox)

The smallest tile entirely containing the given bounding box.

Definition at line 49 of file ztile.cpp.

This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Wed Jan 27 2021 23:02:51 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.