updateRoute: Update (fill-in) a flight plan.

Description Usage Arguments Details Value Examples

Description

This function takes a data.frame of fixes and their coordinates and fills in the flight plan details (courses, distances, airways, etc as in planRoute). This can be used to modify by hand a plan created with planRoute, or even to manually create a plan from scratch (see examples).

Usage

1
updateRoute(plan, cols = c("fix", "fixLat", "fixLon"))

Arguments

plan

A flight plan, as a character vector (of fix names) or as a data.frame. Plans created with planRoute are accepted as input. If a data.frame, it should have a minimum of three columns: waypoint names, latitudes and longitudes. However, it is usually OK to have missing values (see details).

cols

An optional vector of column names, if these are named differently in plan

Details

Provided the fix names are correct and exist in the database, it is not necessary to provide their coordinates; thus plan can be a character vector of fix names, or a data.frame with all NAs on the coordinate columns. Even for non-unique fix names, the correct one will be chosen based on proximity to the nearest fixes. Conversely, if you provide coordinates (in a data.frame), then fixes don't have to be named. However if fixes are not named, then determining the ICAO airway between them is not possible.

If you fly the Tu-154B, the flight plan created with updateRoute can be used with planNVU, but if you have unnamed fixes you must use row numbers for the points= argument.

Value

Returns a data.frame containing the full flight plan, with the same columns as the one returned by planRoute.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# Fly from Athens to Ioannina, manually setting the waypoints
plan <- updateRoute(c("LGAV","KOR","PIKAD","IXONI","GARTA","LGIO"))


# Create a flight plan from Moscow (Domodedovo) to Norilsk (Alykel)
plan0 <- planRoute("UUDD", "UOOO", "WT", "BI01")

# We will manually add waypoints for the final appropach
# (taken from the approach plate):

# Take only the first three columns, and add space before the final row
plan1 <- plan0[c(1:(nrow(plan0)-1), rep(NA,3), nrow(plan0)), 1:3]

# First waypoint is Norilsk NDB (535 BF):
bf <- findFixes("BF", refPoint=as.list(findApt("UOOO")[,c("lat","lon")]), type="NDB")
plan1[nrow(plan1)-4,] <- bf[,c("id","lat","lon")]

# Add coordinates manually for the remaining points
plan1[nrow(plan1)-3,] <- list("D10.0 NOR", 69 + 23.2/60, 87 + 42.5/60)
plan1[nrow(plan1)-2,] <- list("D10.8 NOR", 69 + 26.5/60, 87 + 37.5/60)
plan1[nrow(plan1)-1,] <- list(NA, 69 + 24.1/60, 87 + 30/60)

# Now fill in the rest of the flight plan:
plan2 <- updateRoute(plan1)
print(plan2)

thlytras/rfgfs documentation built on May 31, 2019, 10:44 a.m.