In the previous section we came up with a strategy for creating a horizontal route from our departure waypoint to our arrival waypoint. In this section we will begin constructing this process in Python. For illustration we will construct a route in Alaska from Cold Bay (PACD) to Valdez Pioneer Field (PAVD). We will pick WETSI as our departure waypoint, and OLLEO as our arrival waypoint.
Our chosen departure waypoint at PACD
Our chosen arrival waypoint at PAVD
Note: the charts shown here are more recent than my X-Plane 11 navdata files, but I can quickly confirm that these waypoints still exist in the navdata file by running the information report functionality we created in section 2.5.
First we will create a function to look up the waypoints. The function below will ask the user to disambiguate if duplicates are found.
The illustration below shows the strategy for creating the corridor area from the departure waypoint (A) to the arrival waypoint (B). Starting with the departure waypoint position, we compute the coordinates of the positions 90 nautical miles left and right of the starting waypoint. Then, we advance forward 90 nautical miles and repeat the process. We repeat this until we reach the destination waypoint. The distance of 90 Nmi is arbitrary; I picked the value based on a gut feeling and it gave good results.
Coded, this looks as follows:
This gives:
<class 'dict'>{'left_edge_coords': [LatLon(56°30′43.33″N, 164°21′15.39″W), LatLon(57°30′13.48″N, 162°18′01.83″W), LatLon(58°27′38.99″N, 160°08′08.08″W), LatLon(59°22′48.15″N, 157°51′12.45″W), LatLon(60°15′28.32″N, 155°26′54.94″W), LatLon(61°05′25.9″N, 152°54′58.18″W), LatLon(61°52′26.45″N, 150°15′08.65″W), LatLon(62°22′27.14″N, 148°22′26.36″W)], 'right_edge_coords': [LatLon(54°14′55.9″N, 160°54′31.45″W), LatLon(55°11′03.15″N, 158°53′23.84″W), LatLon(56°05′00.94″N, 156°46′30.48″W), LatLon(56°56′38.71″N, 154°33′38.07″W), LatLon(57°45′45.27″N, 152°14′35.4″W), LatLon(58°32′08.81″N, 149°49′14.05″W), LatLon(59°15′37.05″N, 147°17′29.24″W), LatLon(59°43′16.31″N, 145°31′09.77″W)]}Next we will form these coordinates into polygons, one per sector. For brevity I am going to pull a trick from math book authors and say the proof is left as an exercise for the reader, and just call the functions:
Gives:
<class 'list'>7<class 'geopandas.geodataframe.GeoDataFrame'>To confirm we are on the right track we can visualize our numbers by exporting to .kml file and opening with a GIS tool like Google Earth:
Below we can see the 6 full sectors + 1 remainder sector, spanning a corridor from Cold Bay (left side) to Valdez Field (right side):
In the next section we will search the sectors for enroute waypoints.