+/**
+ * vik_trw_layer_build_waypoint_list_t:
+ *
+ * Helper function to construct a list of #vik_trw_waypoint_list_t
+ */
+GList *vik_trw_layer_build_waypoint_list_t ( VikTrwLayer *vtl, GList *waypoints )
+{
+ GList *waypoints_and_layers = NULL;
+ // build waypoints_and_layers list
+ while ( waypoints ) {
+ vik_trw_waypoint_list_t *vtdl = g_malloc (sizeof(vik_trw_waypoint_list_t));
+ vtdl->wpt = VIK_WAYPOINT(waypoints->data);
+ vtdl->vtl = vtl;
+ waypoints_and_layers = g_list_prepend ( waypoints_and_layers, vtdl );
+ waypoints = g_list_next ( waypoints );
+ }
+ return waypoints_and_layers;
+}
+
+/**
+ * trw_layer_create_waypoint_list:
+ *
+ * Create the latest list of waypoints with the associated layer(s)
+ * Although this will always be from a single layer here
+ */
+static GList* trw_layer_create_waypoint_list ( VikLayer *vl, gpointer user_data )
+{
+ VikTrwLayer *vtl = VIK_TRW_LAYER(vl);
+ GList *waypoints = g_hash_table_get_values ( vik_trw_layer_get_waypoints(vtl) );
+
+ return vik_trw_layer_build_waypoint_list_t ( vtl, waypoints );
+}
+