OSM

OSM Namespace Reference

Namespaces

namespace  IO
 

Classes

class  AbstractReader
 
class  AbstractWriter
 
class  BoundingBox
 
class  Coordinate
 
class  DataSet
 
class  DataSetMergeBuffer
 
class  Element
 
class  IOPluginInterface
 
class  Languages
 
class  Member
 
class  Node
 
class  O5mParser
 
class  O5mWriter
 
class  OsmPbfParser
 
class  OsmPbfWriter
 
class  OverpassQuery
 
class  OverpassQueryManager
 
class  Relation
 
class  Role
 
class  StringKey
 
class  StringKeyRegistry
 
class  StringKeyRegistryBase
 
class  Tag
 
class  TagKey
 
class  UniqueElement
 
class  Way
 
class  XmlWriter
 
class  ZTile
 

Typedefs

typedef int64_t Id
 

Enumerations

enum  : uint8_t {
  O5M_BLOCK_RESET = 0xff , O5M_BLOCK_NODE = 0x10 , O5M_BLOCK_WAY = 0x11 , O5M_BLOCK_RELATION = 0x12 ,
  O5M_BLOCK_BOUNDING_BOX = 0xdb , O5M_BLOCK_TIMESTAMP = 0xdc , O5M_BLOCK_HEADER = 0xe0 , O5M_NUMBER_CONTINUATION = 0b1000'0000 ,
  O5M_NUMBER_MASK = 0b0111'1111 , O5M_NUMBER_SIGNED_BIT = 0b1 , O5M_MEMTYPE_NODE = 0x30 , O5M_MEMTYPE_WAY = 0x31 ,
  O5M_MEMTYPE_RELATION = 0x32 , O5M_TRAILER = 0xfe
}
 
enum  : uint16_t { O5M_STRING_TABLE_SIZE = 15000 , O5M_STRING_TABLE_MAXLEN = 250 }
 
enum  ForeachFlag : uint8_t { IncludeRelations = 1 , IncludeWays = 2 , IncludeNodes = 4 , IterateAll = IncludeRelations | IncludeWays | IncludeNodes }
 
enum class  StringMemory { Persistent , Transient }
 
enum class  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, const std::vector< OSM::Element > &ways, std::vector< const Node * > &path)
 
KOSM_EXPORT void assemblePath (const DataSet &dataSet, std::vector< const Way * > &&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 (const std::vector< const OSM::Node * > &path, Coordinate coord)
 
KOSM_EXPORT double distance (Coordinate coord1, Coordinate coord2)
 
double distance (Coordinate l1, Coordinate l2, Coordinate p)
 
KOSM_EXPORT double distance (double lat1, double lon1, double lat2, double lon2)
 
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)
 
template<typename Elem >
bool operator< (const Elem &elem, Id id)
 
constexpr bool operator< (const Tag &lhs, TagKey rhs)
 
constexpr bool operator< (TagKey lhs, const Tag &rhs)
 
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, QByteArray &&value)
 
template<typename Elem >
QByteArray tagValue (const Elem &elem, const char *keyName)
 
template<typename Elem >
QByteArray tagValue (const Elem &elem, const OSM::Languages &languages, const char *keyName)
 
template<typename Elem >
QByteArray tagValue (const Elem &elem, TagKey key)
 
constexpr BoundingBox unite (BoundingBox bbox1, BoundingBox bbox2)
 
ZTile ztileFromBoundingBox (BoundingBox bbox)
 

Variables

constexpr const char O5M_HEADER [] = "o5m2"
 

Detailed Description

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

Typedef Documentation

◆ Id

typedef int64_t OSM::Id

OSM element identifier.

Definition at line 30 of file datatypes.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum : uint8_t

Definition at line 17 of file o5m.h.

◆ anonymous enum

anonymous enum : uint16_t

Definition at line 37 of file o5m.h.

◆ ForeachFlag

enum OSM::ForeachFlag : uint8_t

Definition at line 145 of file element.h.

◆ StringMemory

enum class OSM::StringMemory
strong

Definition at line 17 of file stringpool.h.

◆ Type

enum class OSM::Type : uint8_t
strong

Element type.

Definition at line 262 of file datatypes.h.

Function Documentation

◆ appendNodesFromWay()

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 @pnodesEnd into nodes.

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

Definition at line 24 of file pathutil.h.

◆ assemblePath() [1/2]

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

Definition at line 61 of file pathutil.cpp.

◆ assemblePath() [2/2]

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.

◆ coalesce() [1/2]

constexpr Element OSM::coalesce ( Element e)
constexpr

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

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

Definition at line 141 of file element.h.

◆ coalesce() [2/2]

template<typename ... Args>
constexpr Element OSM::coalesce ( Element e,
Args... args )
constexpr

Definition at line 143 of file element.h.

◆ contains()

constexpr bool OSM::contains ( BoundingBox bbox,
Coordinate coord )
inlineconstexpr

Definition at line 160 of file datatypes.h.

◆ copy_element()

UniqueElement OSM::copy_element ( Element e)

Creates a copy of element.

Definition at line 300 of file element.cpp.

◆ degToRad()

constexpr double OSM::degToRad ( double deg)
inlineconstexpr

Degree to radian conversion.

Definition at line 19 of file geomath.h.

◆ distance() [1/4]

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 47 of file geomath.cpp.

◆ distance() [2/4]

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

Distance between coord1 and coord2 in meter.

Definition at line 27 of file geomath.cpp.

◆ distance() [3/4]

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 32 of file geomath.cpp.

◆ distance() [4/4]

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

Distance between two coordinates.

Definition at line 16 of file geomath.cpp.

◆ for_each()

template<typename Func >
void OSM::for_each ( const DataSet & dataSet,
Func func,
uint8_t flags = IterateAll )
inline

Definition at line 153 of file element.h.

◆ for_each_member()

template<typename Func >
void OSM::for_each_member ( const DataSet & dataSet,
const Relation & rel,
Func func )
inline

Definition at line 183 of file element.h.

◆ for_each_node()

template<typename Func >
void OSM::for_each_node ( const DataSet & dataSet,
const Way & way,
Func func )
inline

Definition at line 173 of file element.h.

◆ intersects()

constexpr bool OSM::intersects ( BoundingBox bbox1,
BoundingBox bbox2 )
inlineconstexpr

Definition at line 154 of file datatypes.h.

◆ latitudeDistance()

constexpr uint32_t OSM::latitudeDistance ( BoundingBox bbox1,
BoundingBox bbox2 )
inlineconstexpr

Definition at line 166 of file datatypes.h.

◆ longitudeDifference()

constexpr uint32_t OSM::longitudeDifference ( BoundingBox bbox1,
BoundingBox bbox2 )
inlineconstexpr

Definition at line 171 of file datatypes.h.

◆ operator<() [1/3]

template<typename Elem >
bool OSM::operator< ( const Elem & elem,
Id id )
inline

Definition at line 500 of file datatypes.h.

◆ operator<() [2/3]

constexpr bool OSM::operator< ( const Tag & lhs,
TagKey rhs )
inlineconstexpr

Definition at line 200 of file datatypes.h.

◆ operator<() [3/3]

constexpr bool OSM::operator< ( TagKey lhs,
const Tag & rhs )
inlineconstexpr

Definition at line 201 of file datatypes.h.

◆ radToDeg()

constexpr double OSM::radToDeg ( double rad)
inlineconstexpr

Radian to degree conversion.

Definition at line 24 of file geomath.h.

◆ removeTag()

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

Removes a tag from the given element.

Definition at line 491 of file datatypes.h.

◆ setTag()

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 472 of file datatypes.h.

◆ setTagValue()

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

Inserts a new tag, or updates an existing one.

Definition at line 484 of file datatypes.h.

◆ tagValue() [1/3]

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 424 of file datatypes.h.

◆ tagValue() [2/3]

template<typename Elem >
QByteArray OSM::tagValue ( const Elem & elem,
const OSM::Languages & languages,
const char * keyName )
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 437 of file datatypes.h.

◆ tagValue() [3/3]

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

Returns the tag value for key of elem.

Definition at line 410 of file datatypes.h.

◆ unite()

constexpr BoundingBox OSM::unite ( BoundingBox bbox1,
BoundingBox bbox2 )
inlineconstexpr

Definition at line 138 of file datatypes.h.

◆ ztileFromBoundingBox()

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

The smallest tile entirely containing the given bounding box.

Definition at line 49 of file ztile.cpp.

Variable Documentation

◆ O5M_HEADER

constexpr const char OSM::O5M_HEADER[] = "o5m2"
inlineconstexpr

Definition at line 42 of file o5m.h.

This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:20:03 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.