### Combine Flightplans

This feature allows you to combine two separate flight plans into one continuous flight plan. To use this feature:

1. Select exactly two coordinate points from two different point layers
2. Press the Combine Flightplans button
3. Choose which flight plan should be the starting point (waypoint 1)
4. A new layer will be created containing the combined flightplan

The tags of the original waypoints will be preserved in the combined flight plan.

Important Requirements:

- Both layers must have the same Coordinate Reference System (CRS)
- Both layers must be point geometry layers
- Both layers must have an "id" field with all features having a unique ID value
- You must select exactly one point from each layer to serve as the connection points

The resulting combined flight plan preserves all waypoints from both original plans, with sequential IDs starting from the selected point in the first flight plan, continuing through the selected point in the second flight plan, and finally returning to complete any remaining points in the second flight plan and then in the first flight plan.

Or in coding terms:

Given two ordered sequences:

- F1: The sequence of waypoints in flight plan 1
- F2: The sequence of waypoints in flight plan 2
- WP1: The selected waypoint in flight plan 1
- WP2: The selected waypoint in flight plan 1
- Parentheses are exclusive and square brackets are inclusive
- In this example arrays start at index 1 and end at -1

The merged sequence M is defined as:

M = F1[1 : WP1] + F2[WP2 : -1] + F2[1 : WP2) + F1(WP1 : -1]