Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
gpx.h
Go to the documentation of this file.
1/*
2 This file is part of darktable,
3 Copyright (C) 2010-2011 Henrik Andersson.
4 Copyright (C) 2010 johannes hanika.
5 Copyright (C) 2015-2016 Roman Lebedev.
6 Copyright (C) 2016 Tobias Ellinghaus.
7 Copyright (C) 2019-2021 Pascal Obry.
8 Copyright (C) 2021 Paolo Benvenuto.
9 Copyright (C) 2021 Philippe Weyland.
10 Copyright (C) 2022 Martin Baƙinka.
11
12 darktable is free software: you can redistribute it and/or modify
13 it under the terms of the GNU General Public License as published by
14 the Free Software Foundation, either version 3 of the License, or
15 (at your option) any later version.
16
17 darktable 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 You should have received a copy of the GNU General Public License
23 along with darktable. If not, see <http://www.gnu.org/licenses/>.
24*/
25
26#ifndef DT_METADATA_GPX_H
27#define DT_METADATA_GPX_H
28
29#include <glib.h>
30#include "common/image.h"
31
32#define EARTH_RADIUS 6378100.0 /* in meters */
33#define DT_MINIMUM_DISTANCE_FOR_GEODESIC 100000.0 /* in meters */
34#define DT_MINIMUM_ANGULAR_DELTA_FOR_GEODESIC 1.0
35/* DT_MINIMUM_ANGULAR_DELTA_FOR_GEODESIC is in degrees, and is used for longitude and latitude
36 0.1 degress ~ 10 km on the earth surface */
37
38struct dt_gpx_t;
39
41{
43 GDateTime *time;
44 uint32_t segid;
46
56
57/* loads and parses a gpx track file */
58struct dt_gpx_t *dt_gpx_new(const gchar *filename);
59void dt_gpx_destroy(struct dt_gpx_t *gpx);
60
61/* fetch the lon,lat coords for time t, if within time range
62 of gpx record return TRUE, FALSE is returned if out of time frame
63 and closest record of lon,lat is filled */
64gboolean dt_gpx_get_location(struct dt_gpx_t *, GDateTime *timestamp, dt_image_geoloc_t *geoloc);
65
66// get the list of track segments
67GList *dt_gpx_get_trkseg(struct dt_gpx_t *gpx);
68
69// get the list of track points for a track segment
70GList *dt_gpx_get_trkpts(struct dt_gpx_t *gpx, const guint segid);
71
72// get the distance on the geodesic line and the angle delta referred to earth center
73void dt_gpx_geodesic_distance(double lat1, double lon1,
74 double lat2, double lon2,
75 double *d, double *delta);
76
77/* get the intermediate point (lat, lon) on the geodesic line between point 1 and point 2
78 which form an angle delta (calculated by dt_gpx_geodesic_distance)
79 corresponding to fraction f
80 boolean first_time is in order to reduce unnecessary calculations */
81void dt_gpx_geodesic_intermediate_point(const double lat1, const double lon1,
82 const double lat2, const double lon2,
83 const double delta,
84 const gboolean first_time,
85 double f,
86 double *lat, double *lon);
87
88#endif // DT_METADATA_GPX_H
89
90// clang-format off
91// modelines: These editor modelines have been set for all relevant files by tools/update_modelines.py
92// vim: shiftwidth=2 expandtab tabstop=2 cindent
93// kate: tab-indents: off; indent-width 2; replace-tabs on; indent-mode cstyle; remove-trailing-spaces modified;
94// clang-format on
95
const float f
const float delta
void dt_gpx_destroy(struct dt_gpx_t *gpx)
Definition gpx.c:153
GList * dt_gpx_get_trkpts(struct dt_gpx_t *gpx, const guint segid)
Definition gpx.c:449
struct dt_gpx_t * dt_gpx_new(const gchar *filename)
Definition gpx.c:89
gboolean dt_gpx_get_location(struct dt_gpx_t *, GDateTime *timestamp, dt_image_geoloc_t *geoloc)
Definition gpx.c:171
void dt_gpx_geodesic_intermediate_point(const double lat1, const double lon1, const double lat2, const double lon2, const double delta, const gboolean first_time, double f, double *lat, double *lon)
Definition gpx.c:494
GList * dt_gpx_get_trkseg(struct dt_gpx_t *gpx)
Definition gpx.c:444
void dt_gpx_geodesic_distance(double lat1, double lon1, double lat2, double lon2, double *d, double *delta)
Definition gpx.c:473
float lat
Definition location.c:3
float lon
Definition location.c:2
Definition gpx.c:49
uint32_t segid
Definition gpx.c:59
gdouble longitude
Definition gpx.h:42
GDateTime * time
Definition gpx.h:43
gdouble elevation
Definition gpx.h:42
uint32_t segid
Definition gpx.h:44
gdouble latitude
Definition gpx.h:42
dt_gpx_track_point_t * trkpt
Definition gpx.h:53
GDateTime * start_dt
Definition gpx.h:50
GDateTime * end_dt
Definition gpx.h:51
uint32_t nb_trkpt
Definition gpx.h:54