position.h
Go to the documentation of this file.
/*
* Copyright © 2012-2013 Canonical Ltd.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License version 3,
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* Authored by: Thomas Voß <thomas.voss@canonical.com>
*/
#ifndef LOCATION_SERVICE_COM_LOMIRI_LOCATION_POSITION_H_
#define LOCATION_SERVICE_COM_LOMIRI_LOCATION_POSITION_H_
#include <com/lomiri/location/wgs84/altitude.h>
#include <com/lomiri/location/wgs84/latitude.h>
#include <com/lomiri/location/wgs84/longitude.h>
#include <com/lomiri/location/optional.h>
#include <bitset>
#include <ostream>
namespace com
{
namespace lomiri
{
namespace location
{
struct Position
{
struct Accuracy
{
typedef units::Quantity<units::Length> Horizontal;
typedef units::Quantity<units::Length> Vertical;
Optional<Horizontal> horizontal{};
Optional<Vertical> vertical{};
};
Position() = default;
Position(const wgs84::Latitude&, const wgs84::Longitude&);
Position(const wgs84::Latitude&, const wgs84::Longitude&, const wgs84::Altitude&);
Position(const wgs84::Latitude&, const wgs84::Longitude&, const wgs84::Altitude&, const units::Quantity<units::Length>& hor_acc);
Position(const wgs84::Latitude&, const wgs84::Longitude&, const wgs84::Altitude&, const units::Quantity<units::Length>& hor_acc, const units::Quantity<units::Length>& ver_acc);
bool operator==(const Position& rhs) const;
bool operator!=(const Position& rhs) const;
wgs84::Latitude latitude = wgs84::Latitude{};
wgs84::Longitude longitude = wgs84::Longitude{};
Optional<wgs84::Altitude> altitude = Optional<wgs84::Altitude>{};
Accuracy accuracy{};
};
std::ostream& operator<<(std::ostream& out, const Position& position);
units::Quantity<units::Length> haversine_distance(const Position& p1, const Position& p2);
}
}
}
#endif // LOCATION_SERVICE_COM_LOMIRI_LOCATION_POSITION_H_
altitude.h
latitude.h
longitude.h
com::lomiri::location::units::Quantity
boost::units::quantity< Unit, double > Quantity
Definition units.h:60
com::lomiri::location::wgs84::Altitude
Coordinate< tag::Altitude, units::Length > Altitude
Definition altitude.h:36
com::lomiri::location::wgs84::Longitude
Coordinate< tag::Longitude, units::PlaneAngle > Longitude
Definition longitude.h:38
com::lomiri::location::wgs84::Latitude
Coordinate< tag::Latitude, units::PlaneAngle > Latitude
Definition latitude.h:38
com::lomiri::location
Definition accuracy.h:28
com::lomiri::location::operator<<
std::ostream & operator<<(std::ostream &out, const Accuracy< T > &update)
Definition accuracy.h:68
com::lomiri::location::Optional
boost::optional< T > Optional
Definition optional.h:31
com::lomiri::location::haversine_distance
units::Quantity< units::Length > haversine_distance(const Position &p1, const Position &p2)
com::lomiri
Definition accuracy.h:26
com
Definition accuracy.h:24
optional.h
com::lomiri::location::Position::Accuracy
Definition position.h:42
com::lomiri::location::Position::Accuracy::Vertical
units::Quantity< units::Length > Vertical
Definition position.h:44
com::lomiri::location::Position::Accuracy::vertical
Optional< Vertical > vertical
Definition position.h:47
com::lomiri::location::Position::Accuracy::Horizontal
units::Quantity< units::Length > Horizontal
Definition position.h:43
com::lomiri::location::Position::Accuracy::horizontal
Optional< Horizontal > horizontal
Definition position.h:46
com::lomiri::location::Position
The Position struct models a position in the wgs84 coordinate system.
Definition position.h:40
com::lomiri::location::Position::altitude
Optional< wgs84::Altitude > altitude
Definition position.h:61
com::lomiri::location::Position::Position
Position(const wgs84::Latitude &, const wgs84::Longitude &)
com::lomiri::location::Position::Position
Position(const wgs84::Latitude &, const wgs84::Longitude &, const wgs84::Altitude &, const units::Quantity< units::Length > &hor_acc)
com::lomiri::location::Position::Position
Position(const wgs84::Latitude &, const wgs84::Longitude &, const wgs84::Altitude &, const units::Quantity< units::Length > &hor_acc, const units::Quantity< units::Length > &ver_acc)
com::lomiri::location::Position::longitude
wgs84::Longitude longitude
Definition position.h:60
com::lomiri::location::Position::Position
Position(const wgs84::Latitude &, const wgs84::Longitude &, const wgs84::Altitude &)
com::lomiri::location::Position::operator==
bool operator==(const Position &rhs) const
com::lomiri::location::Position::Position
Position()=default
com::lomiri::location::Position::accuracy
Accuracy accuracy
Definition position.h:62
com::lomiri::location::Position::operator!=
bool operator!=(const Position &rhs) const
com::lomiri::location::Position::latitude
wgs84::Latitude latitude
Definition position.h:59