libosmscout  0.1
osmscout::Point Class Referencefinal

#include <Point.h>

Public Member Functions

void ClearSerial ()
 
const GeoCoordGetCoord () const
 
Id GetId () const
 Returns a fast calculable unique id for the coordinate under consideration that different OSM nodes with the same coordinate will have different ids if the identity of the node is important - else the serial id will be 0. More...
 
double GetLat () const
 
double GetLon () const
 
uint8_t GetSerial () const
 
bool IsEqual (const Point &other) const
 Same semantics as IsSame(), implement for template compatibility with GeoCoord. More...
 
bool IsIdentical (const Point &other) const
 Compare this and the other point for identity. More...
 
bool IsRelevant () const
 
bool IsSame (const Point &other) const
 Compare this and the other point for "sameness". More...
 
bool operator< (const Point &other) const
 While we do not want to compare using operator== we at least want to manage points in containers. More...
 
 Point ()=default
 
 Point (uint8_t serial, const GeoCoord &coords)
 
void Set (uint8_t serial, const GeoCoord &coords)
 
void SetCoord (const GeoCoord &coords)
 
void SetSerial (uint8_t serial)
 

Static Public Member Functions

static GeoCoord GetCoordFromId (Id id)
 

Detailed Description

A point is a identifiable (has an id) geo-coordinate.

Constructor & Destructor Documentation

◆ Point() [1/2]

osmscout::Point::Point ( )
default

◆ Point() [2/2]

osmscout::Point::Point ( uint8_t  serial,
const GeoCoord coords 
)
inline

Member Function Documentation

◆ ClearSerial()

void osmscout::Point::ClearSerial ( )
inline

◆ GetCoord()

◆ GetCoordFromId()

GeoCoord osmscout::Point::GetCoordFromId ( Id  id)
static

◆ GetId()

Id osmscout::Point::GetId ( ) const

Returns a fast calculable unique id for the coordinate under consideration that different OSM nodes with the same coordinate will have different ids if the identity of the node is important - else the serial id will be 0.

The id does not have any semantics regarding sorting. Coordinates with close ids do not need to be close in location.

References osmscout::GeoCoord::GetLat(), osmscout::GeoCoord::GetLon(), osmscout::latConversionFactor, and osmscout::lonConversionFactor.

Referenced by osmscout::PolygonMerger::AddPolygon(), and osmscout::RouteNode::GetId().

◆ GetLat()

double osmscout::Point::GetLat ( ) const
inline

◆ GetLon()

double osmscout::Point::GetLon ( ) const
inline

◆ GetSerial()

uint8_t osmscout::Point::GetSerial ( ) const
inline

◆ IsEqual()

bool osmscout::Point::IsEqual ( const Point other) const
inline

Same semantics as IsSame(), implement for template compatibility with GeoCoord.

Parameters
otherOther point to compare against
Returns
true if same location, else false

◆ IsIdentical()

bool osmscout::Point::IsIdentical ( const Point other) const
inline

Compare this and the other point for identity.

Identity is defined as have the same coordinates and the same serial id per coordinate.

Parameters
otherOther point to compare against
Returns
true if identical, else false

Referenced by osmscout::LocationDescriptionService::DescribeLocationByCrossing().

◆ IsRelevant()

bool osmscout::Point::IsRelevant ( ) const
inline

◆ IsSame()

bool osmscout::Point::IsSame ( const Point other) const
inline

Compare this and the other point for "sameness".

Sameness is defined as having the same coordinate but not necessarily the same serial id. This means, that both points have the same location but are not necessarily identical.

Parameters
otherOther point to compare against
Returns
true if same location, else false

◆ operator<()

bool osmscout::Point::operator< ( const Point other) const
inline

While we do not want to compare using operator== we at least want to manage points in containers.

So we need to implement operator<.

Parameters
otherOther point to compare to
Returns
true or false

References GetCoord().

◆ Set()

void osmscout::Point::Set ( uint8_t  serial,
const GeoCoord coords 
)
inline

◆ SetCoord()

void osmscout::Point::SetCoord ( const GeoCoord coords)
inline

◆ SetSerial()

void osmscout::Point::SetSerial ( uint8_t  serial)
inline

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