Libosmium  2.16.0
Fast and flexible C++ library for working with OpenStreetMap data
Public Member Functions | Private Attributes | List of all members
osmium::NodeRef Class Reference

#include <node_ref.hpp>

Inheritance diagram for osmium::NodeRef:
Inheritance graph
[legend]
Collaboration diagram for osmium::NodeRef:
Collaboration graph
[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::Locationlocation () 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
 
NodeRefset_ref (const osmium::object_id_type ref) noexcept
 
NodeRefset_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{} 
)
inlinenoexcept

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_locationif the location is not set.

◆ location() [1/2]

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

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

◆ location() [2/2]

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

Get location of this NodeRef.

◆ lon()

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

Get longitude of the location in this NodeRef.

Exceptions
osmium::invalid_locationif the location is not set.

◆ positive_ref()

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

Get absolute value of the reference ID of this NodeRef.

◆ ref()

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

Get reference ID of this NodeRef.

◆ set_location()

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

Set the location.

Returns
Reference to this NodeRef for chaining calls.

◆ set_ref()

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

Set the referenced ID.

Returns
Reference to this NodeRef for chaining calls.

◆ x()

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

Get internal x value of the location in this NodeRef.

◆ y()

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

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: