Top | ![]() |
![]() |
![]() |
![]() |
void
vik_track_set_defaults (VikTrack *tr
);
Set some default values for a track. ATM This uses the 'settings' method to get values, so there is no GUI way to control these yet...
void vik_track_set_description (VikTrack *tr
,const gchar *description
);
VikTrack * vik_track_copy (const VikTrack *tr
,gboolean copy_points
);
Normally for copying the track it's best to copy all the trackpoints However for some operations such as splitting tracks the trackpoints will be managed separately, so no need to copy them.
void vik_track_add_trackpoint (VikTrack *tr
,VikTrackpoint *tp
,gboolean recalculate
);
The trackpoint is added to the end of the existing trackpoint list
tr |
The track to which the trackpoint will be added |
|
tp |
The trackpoint to add |
|
recalculate |
Whether to perform any associated properties recalculations
Generally one should avoid recalculation via this method if adding lots of points
(But ensure |
gdouble vik_track_get_length_to_trackpoint (const VikTrack *tr
,const VikTrackpoint *tp
);
gdouble
vik_track_get_length_including_gaps (const VikTrack *tr
);
VikTrack ** vik_track_split_into_segments (VikTrack *tr
,guint *ret_len
);
gdouble vik_track_get_duration (const VikTrack *trk
,gboolean include_segments
);
gulong
vik_track_get_same_time_point_count (const VikTrack *vt
);
gdouble vik_track_get_average_speed_moving (const VikTrack *tr
,int stop_length_seconds
);
gdouble * vik_track_make_elevation_map (const VikTrack *tr
,guint16 num_chunks
);
void vik_track_get_total_elevation_gain (const VikTrack *tr
,gdouble *up
,gdouble *down
);
elevation gains and losses may be NAN if no elevations are available
VikTrackpoint * vik_track_get_tp_by_dist (VikTrack *trk
,gdouble meters_from_start
,gboolean get_next_point
,gdouble *tp_metres_from_start
);
TODO: Consider changing the boolean get_next_point into an enum with these options PREVIOUS, NEXT, NEAREST
trk |
The Track on which to find a Trackpoint |
|
meters_from_start |
The distance along a track that the trackpoint returned is near |
|
get_next_point |
Since there is a choice of trackpoints, this determines which one to return |
|
tp_metres_from_start |
For the returned Trackpoint, returns the distance along the track |
VikTrackpoint * vik_track_get_closest_tp_by_percentage_dist (VikTrack *tr
,gdouble reldist
,gdouble *meters_from_start
);
VikTrackpoint * vik_track_get_closest_tp_by_percentage_time (VikTrack *tr
,gdouble reldist
,gdouble *seconds_from_start
);
VikTrackpoint * vik_track_get_tp_by_max_speed (const VikTrack *tr
,gboolean by_gps_speed
);
VikTrackpoint * vik_track_get_tp_prev (const VikTrack *tr
,VikTrackpoint *tp
);
gdouble * vik_track_make_gradient_map (const VikTrack *tr
,guint16 num_chunks
);
gdouble * vik_track_make_speed_map (const VikTrack *tr
,guint16 num_chunks
);
gdouble * vik_track_make_distance_map (const VikTrack *tr
,guint16 num_chunks
);
gdouble * vik_track_make_elevation_time_map (const VikTrack *tr
,guint16 num_chunks
);
gdouble * vik_track_make_speed_dist_map (const VikTrack *tr
,guint16 num_chunks
);
gboolean vik_track_get_minmax_alt (const VikTrack *tr
,gdouble *min_alt
,gdouble *max_alt
);
Finds the minimum and maximum altitudes in the specified track
void
vik_track_anonymize_times (VikTrack *tr
);
Shift all timestamps to be relatively offset from 1901-01-01
void
vik_track_interpolate_times (VikTrack *tr
);
Interpolate the timestamps between first and last trackpoint, so that the track is driven at equal speed, regardless of the distance between individual trackpoints.
NB This will overwrite any existing trackpoint timestamps
gulong vik_track_apply_dem_data (VikTrack *tr
,gboolean skip_existing
);
Set elevation data for a track using any available DEM information
gulong vik_track_smooth_missing_elevation_data (VikTrack *tr
,gboolean flat
);
For each point with a missing elevation, set it to use the last known available elevation value. Primarily of use for smallish DEM holes where it is missing elevation data. Eg see Austria: around N47.3 & E13.8
void vik_track_steal_and_append_trackpoints (VikTrack *t1
,VikTrack *t2
);
appends t2 to t1, leaving t2 with no trackpoints
VikCoord *
vik_track_cut_back_to_double_point (VikTrack *tr
);
starting at the end, looks backwards for the last "double point", a duplicate trackpoint. If there is no double point, deletes all the trackpoints.
void vik_track_set_property_dialog (VikTrack *tr
,GtkWidget *dialog
);
struct VikTrackpoint { gchar* name; VikCoord coord; gboolean newsegment; gdouble timestamp; /* NAN if data unavailable */ gdouble altitude; /* NAN if data unavailable */ gdouble speed; /* NAN if data unavailable */ gdouble course; /* NAN if data unavailable */ guint nsats; /* number of satellites used. 0 if data unavailable */ guint fix_mode; /* VIK_GPS_MODE_NOT_SEEN if data unavailable */ gdouble hdop; /* NAN if data unavailable */ gdouble vdop; /* NAN if data unavailable */ gdouble pdop; /* NAN if data unavailable */ gchar *extensions; // GPX 1.1 extensions - currently uneditable guint heart_rate; // Beats per Minute (bpm): 0 if data unavailable gint cadence; // In Revs Per Minute (RPM): VIK_TRKPT_CADENCE_NONE if data unavailable gdouble temp; // Temperature is in degrees C: NAN if data unavailable gint power; // Watts: VIK_TRKPT_POWER_NONE if data unavailable };
struct VikTrack { GList *trackpoints; gboolean visible; gboolean is_route; VikTrackDrawnameType draw_name_mode; guint8 max_number_dist_labels; gchar *comment; gchar *description; gchar *source; guint number; gchar *type; guint8 ref_count; gchar *name; gchar *extensions; // GPX 1.1 extensions - currently uneditable GtkWidget *property_dialog; gboolean has_color; GdkColor color; LatLonBBox bbox; };