* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
#include <glib.h>
#include <time.h>
#include <stdlib.h>
+#ifdef HAVE_STRING_H
#include <string.h>
+#endif
+#ifdef HAVE_MATH_H
#include <math.h>
+#endif
+
#include "coords.h"
#include "vikcoord.h"
#include "viktrack.h"
VikTrackpoint *vik_trackpoint_new()
{
VikTrackpoint *tp = g_malloc0(sizeof(VikTrackpoint));
- tp->extended = FALSE;
tp->speed = NAN;
tp->course = NAN;
+ tp->altitude = VIK_DEFAULT_ALTITUDE;
+ tp->hdop = VIK_DEFAULT_DOP;
+ tp->vdop = VIK_DEFAULT_DOP;
+ tp->pdop = VIK_DEFAULT_DOP;
return tp;
}
chunk_length = total_length / num_chunks;
/* Zero chunk_length (eg, track of 2 tp with the same loc) will cause crash */
- if (chunk_length <= 0)
+ if (chunk_length <= 0) {
+ g_free(pts);
return NULL;
+ }
current_dist = 0.0;
current_area_under_curve = 0;