Loading...
Searching...
No Matches
osmium::NodeRef Class Reference

`#include <node_ref.hpp>`

Inheritance diagram for osmium::NodeRef:
[legend]
Collaboration diagram for osmium::NodeRef:
[legend]

## Public Member Functions

constexpr | NodeRef (const osmium::object_id_type ref=0, const osmium::Location &location=Location{}) noexcept
constexpr osmium::object_id_type | ref () const noexcept
osmium::unsigned_object_id_type | positive_ref () const noexcept
osmium::Location & | location () noexcept
constexpr osmium::Location | location () const noexcept
double | lon () const
double | lat () const
constexpr int32_t | x () const noexcept
constexpr int32_t | y () const noexcept
NodeRef & | set_ref (const osmium::object_id_type ref) noexcept
NodeRef & | set_location (const osmium::Location &location) noexcept

## Private Attributes

osmium::object_id_type | m_ref
osmium::Location | m_location

## Detailed Description

This reference to a node contains a node ID and a (possibly empty) location.

## Constructor & Destructor Documentation

## NodeRef()

constexpr osmium::NodeRef::NodeRef | ( | const osmium::object_id_type | ref = `0`,
|  | const osmium::Location & | location = `Location{}`
| ) |  |

inline constexpr noexcept

Constructor for NodeRef

This is not explicit to allow implicit construction from an object ID.

## Member Function Documentation

## lat()

double osmium::NodeRef::lat | ( |  | ) | const

inline

Get latitude of the location in this NodeRef.

Exceptions

  osmium::invalid_location | if the location is not set.

## location() [1/2]

constexpr osmium::Location osmium::NodeRef::location | ( |  | ) | const

inline constexpr noexcept

Get location of this NodeRef.

## location() [2/2]

osmium::Location & osmium::NodeRef::location | ( |  | ) |

inline noexcept

Get reference to location in this NodeRef. Can be used to update it.

## lon()

double osmium::NodeRef::lon | ( |  | ) | const

inline

Get longitude of the location in this NodeRef.

Exceptions

  osmium::invalid_location | if the location is not set.

## positive_ref()

osmium::unsigned_object_id_type osmium::NodeRef::positive_ref | ( |  | ) | const

inline noexcept

Get absolute value of the reference ID of this NodeRef.

## ref()

constexpr osmium::object_id_type osmium::NodeRef::ref | ( |  | ) | const

inline constexpr noexcept

Get reference ID of this NodeRef.

## set_location()

NodeRef & osmium::NodeRef::set_location | ( | const osmium::Location & | location | ) |

inline noexcept

Set the location.

Returns
  Reference to this NodeRef for chaining calls.

## set_ref()

NodeRef & osmium::NodeRef::set_ref | ( | const osmium::object_id_type | ref | ) |

inline noexcept

Set the referenced ID.

Returns
  Reference to this NodeRef for chaining calls.

## x()

constexpr int32_t osmium::NodeRef::x | ( |  | ) | const

inline constexpr noexcept

Get internal x value of the location in this NodeRef.

## y()

constexpr int32_t osmium::NodeRef::y | ( |  | ) | const

inline constexpr noexcept

Get internal y value of the location in this NodeRef.

## Member Data Documentation

## m_location

osmium::Location osmium::NodeRef::m_location

private

## m_ref

osmium::object_id_type osmium::NodeRef::m_ref

private

The documentation for this class was generated from the following file:

- include/osmium/osm/node_ref.hpp