olp-cpp-sdk  1.22.0
Public Member Functions | Public Attributes | List of all members
olp::geo::GeoPoint Class Reference

A geographic location that uses the WGS84 Coordinate System encoded in a 32-bit unsigned integer. More...

#include <GeoPoint.h>

Public Member Functions

 GeoPoint (uint32_t xx, uint32_t yy)
 Creates the GeoPoint instance that uses the location longitude (x) and latitude (y) values represented as 32-bit unsigned integers. More...
 
bool operator== (const GeoPoint &other) const
 Checks whether the values of the GeoPoint and the other parameters are equal. More...
 
bool operator!= (const GeoPoint &other) const
 Checks whether the values of the GeoPoint and the other parameters are not equal. More...
 
GeoPointoperator+= (const GeoPoint &other)
 Adds the values of the GeoPoint and other parameters. More...
 

Public Attributes

std::uint32_t x
 An absolute world X-coordinate value. More...
 
std::uint32_t y
 An absolute world Y-coordinate value. More...
 

Detailed Description

A geographic location that uses the WGS84 Coordinate System encoded in a 32-bit unsigned integer.

Latitude values range from 0 at the equator to 90 degrees north and -90 degrees south. Longitude values range from 0 at the prime meridian to 180 degrees east and -180 degrees west.

The X-Y coordinates system is used to get the geographic location:

The internal representation of angles is radians:

To get GeoPoint from geographic coordinates, you can use the ToGeoPoint method of the GeoCoordinates class.

Constructor & Destructor Documentation

◆ GeoPoint()

olp::geo::GeoPoint::GeoPoint ( uint32_t  xx,
uint32_t  yy 
)
inline

Creates the GeoPoint instance that uses the location longitude (x) and latitude (y) values represented as 32-bit unsigned integers.

Parameters
[in]xxThe X-coordinate value of the location longitude.
[in]yyThe Y-coordinate value of the location latitude.

Member Function Documentation

◆ operator!=()

bool olp::geo::GeoPoint::operator!= ( const GeoPoint other) const
inline

Checks whether the values of the GeoPoint and the other parameters are not equal.

Parameters
otherThe GeoPoint instance.
Returns
True if the values are not equal; false otherwise.

◆ operator+=()

GeoPoint & olp::geo::GeoPoint::operator+= ( const GeoPoint other)
inline

Adds the values of the GeoPoint and other parameters.

Parameters
otherThe GeoPoint instance.
Returns
The reference to the GeoPoint instance.

◆ operator==()

bool olp::geo::GeoPoint::operator== ( const GeoPoint other) const
inline

Checks whether the values of the GeoPoint and the other parameters are equal.

Parameters
otherThe GeoPoint instance.
Returns
True if the values are equal; false otherwise.

Member Data Documentation

◆ x

std::uint32_t olp::geo::GeoPoint::x

An absolute world X-coordinate value.

The value range for each component is a 32-bit unsigned integer.

The x value can be calculated using the following formula: x = (x rad + pi) * max(uint32_t) / 2 * pi.

◆ y

std::uint32_t olp::geo::GeoPoint::y

An absolute world Y-coordinate value.

The value range for each component is a 32-bit unsigned integer.

The y value can be calculated using the following formula: y = (y rad + pi/2) * max(uint32_t) / 2 * pi.


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