digiKam
geodataparser.h
Go to the documentation of this file.
1 /* ============================================================
2  *
3  * This file is a part of digiKam project
4  * https://www.digikam.org
5  *
6  * Date : 2006-09-19
7  * Description : GPS data file parser.
8  * (GPX format https://www.topografix.com/gpx.asp).
9  *
10  * Copyright (C) 2006-2022 by Gilles Caulier <caulier dot gilles at gmail dot com>
11  *
12  * This program is free software; you can redistribute it
13  * and/or modify it under the terms of the GNU General
14  * Public License as published by the Free Software Foundation;
15  * either version 2, or (at your option) any later version.
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU General Public License for more details.
21  *
22  * ============================================================ */
23 
24 #ifndef DIGIKAM_GEO_DATA_PARSER_H
25 #define DIGIKAM_GEO_DATA_PARSER_H
26 
27 // Qt includes
28 
29 #include <QDateTime>
30 #include <QMap>
31 #include <QUrl>
32 
33 // Local includes
34 
35 #include "geodatacontainer.h"
36 
38 {
39 
41 {
42 
43 public:
44 
45  explicit GeoDataParser();
47 
48  bool loadGPXFile(const QUrl& url);
49 
50  void clear();
51  int numPoints() const;
52  bool matchDate(const QDateTime& photoDateTime, int maxGapTime, int secondsOffset,
53  bool photoHasSystemTimeZone,
54  bool interpolate, int interpolationDstTime,
55  GeoDataContainer* const gpsData);
56 
57 private:
58 
60  QDateTime findNextDate(const QDateTime& dateTime, int secs);
61  QDateTime findPrevDate(const QDateTime& dateTime, int secs);
62 
63 protected:
64 
65  typedef QMap<QDateTime, GeoDataContainer> GeoDataMap;
66 
68 };
69 
70 } // namespace DigikamGenericGeolocationEditPlugin
71 
72 #endif // DIGIKAM_GEO_DATA_PARSER_H
void clear()
Definition: geodataparser.cpp:51
GeoDataMap m_GeoDataMap
Definition: geodataparser.h:67
int numPoints() const
Definition: geodataparser.cpp:56
bool matchDate(const QDateTime &photoDateTime, int maxGapTime, int secondsOffset, bool photoHasSystemTimeZone, bool interpolate, int interpolationDstTime, GeoDataContainer *const gpsData)
Definition: geodataparser.cpp:61
~GeoDataParser()
Definition: geodataparser.h:46
GeoDataParser()
Definition: geodataparser.cpp:46
QMap< QDateTime, GeoDataContainer > GeoDataMap
Definition: geodataparser.h:65
bool loadGPXFile(const QUrl &url)
Definition: geodataparser.cpp:210
Definition: geolocationedit.cpp:97