plot_flight_horizontal: Plot the recorded positions of a flight on a map.

Description Usage Arguments Value See Also Examples

View source: R/plot.R

Description

Plot the recorded positions of a flight on a map.

Usage

1
2
plot_flight_horizontal(poss, bbox = NULL, buffer = 100,
  legend.position = "none", shape = NULL)

Arguments

poss

a dataframe of position reports with (at least) 'callsign', 'timestamp' (a date-time), 'altitude' (in feet), 'longitude' (in decimal degrees) and 'latitude' (in decimal degrees) columns

bbox

a bounding box in the format c(lowerleftlon, lowerleftlat, upperrightlon, upperrightlat).

buffer

number of nautical miles (NM) around the bounding box (default 40)

legend.position

legend position as per ggplot2 (default "none", i.e. do not show it).

shape

shape of point to plot (default NULL, i.e. do not plot positions, only paths). See shape in geom_point.

Value

a ggplot2 plot object.

See Also

Other plot functions: plot_cpr_horizontal, plot_flight_vertical_distance, plot_flight_vertical_time

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
26
27
28
## Not run: 
library(dplyr)

# define the bounding box of interest
europe <- c(left = 5, bottom = 35, right = 30, top = 52)
plot_flight_horizontal(poss, europe)
plot_flight_horizontal(poss, buffer = 10) # 10km around the values

# from DB to plot
p <- export_flights_at_airport_fr24("2017-09-01T00:00:00Z",
                                    "2017-09-02T00:00:00Z",
                                    "SVG",
                                    5.638, 58.877) %>%
  # NOTE: convert till DB columns are properly changed
  mutate(longitude = as.numeric(LON), latitude = as.numeric(LAT)) %>%
  select(FLIGHT_ID, EVENT_TIME, longitude, latitude)

f <- export_flights_at_airport_fr24("2017-09-01T00:00:00Z",
                                    "2017-09-02T00:00:00Z",
                                    "SVG",
                                    flow = "ARR") %>%
  rename(callsign = CALLSIGN) %>%
  select(FLIGHT_ID, callsign)

p1 <- p %>% left_join(f) %>% filter(!is.na(callsign))
plot_flight_horizontal(p1)

## End(Not run)

euctrl-pru/trrrj documentation built on Nov. 10, 2019, 12:41 p.m.