File indexing completed on 2024-12-08 07:19:13

0001 /*
0002     SPDX-FileCopyrightText: 2022 Volker Krause <vkrause@kde.org>
0003     SPDX-License-Identifier: LGPL-2.0-or-later
0004 */
0005 
0006 #ifndef KPUBLICTRANSPORT_POSITIONDATA_H
0007 #define KPUBLICTRANSPORT_POSITIONDATA_H
0008 
0009 #include <QDateTime>
0010 
0011 #include <cmath>
0012 
0013 namespace KPublicTransport {
0014 
0015 /** Current position reading. */
0016 class PositionData
0017 {
0018 public:
0019     inline bool hasCoordinate() const
0020     {
0021         return !std::isnan(latitude) && !std::isnan(longitude);
0022     }
0023 
0024     float latitude = NAN;
0025     float longitude = NAN;
0026     float speed = NAN; // km/h
0027     float heading = NAN; // degree
0028     float altitude = NAN; // meter
0029     QDateTime timestamp;
0030 
0031     // further commonly / sometimes available values: altitude, temperature
0032 };
0033 
0034 }
0035 
0036 #endif // KPUBLICTRANSPORT_POSITIONDATA_H