plotRoutes {openSkies} | R Documentation |
Plot several aircraft routes
Description
Draws the given routes on a ggmap object. The routes must be given as a list of
objects of class openSkiesStateVectorSet
, all of them with field
time_series=TRUE
.
Usage
plotRoutes(stateVectorSetList, pathColors="blue", ggmapObject=NULL,
plotResult=TRUE, paddingFactor=0.2, lineSize=1, lineAlpha=0.5, pointSize=0.3,
pointAlpha=0.8, includeArrows=FALSE, arrowLength=0.3, literalColors=TRUE)
Arguments
stateVectorSetList |
list of objects of class |
pathColors |
If |
ggmapObject |
optional ggmap object on which the routes will be drawn. By default, a new ggmap object will be created, covering the necessary space plus an amount of padding determined by the paddingFactor argument. |
plotResult |
wether or not the resulting ggmap object with the added routes should be plotted. |
paddingFactor |
amount of padding to add to the map if no ggmap object is provided. The added padding will be equal to paddingFactor multiplied by the height and width of the map (determined by the difference between the maximum and minimum longitudes/latitudes). |
lineSize |
width of the line that connects the points of the routes in the plot. |
lineAlpha |
opacity of the line that connects the points of the routes in the plot. |
pointSize |
size of the points of the routes in the plot. |
pointAlpha |
opacity of the points of the routes in the plot. |
includeArrows |
logical indicating if arrows showing the direction of the flight should be added to the plot. The default value of FALSE can speed up the generation of the plot considerably when a large amount of routes are plotted. |
arrowLength |
length of the segment arrows in centimeters. |
literalColors |
logical indicating if the values provided through
|
Value
A ggmap object with added paths and points representing the routes.
References
https://opensky-network.org/apidoc/rest
Examples
# Plot the routes followed by two aircrafts departing from Sevilla airport the
# 4th of November, 2020.
if(interactive()){
vectors1=getAircraftStateVectorsSeries(aircraft="345107",
startTime="2020-11-04 11:55:00", endTime="2020-11-04 13:10:00",
timeZone="Europe/London", timeResolution=300)
vectors2=getAircraftStateVectorsSeries(aircraft = "4ca7b3",
startTime="2020-11-04 10:30:00", endTime="2020-11-04 12:00:00",
timeZone="Europe/London", timeResolution=300)
plotRoutes(list(vectors1, vectors2), pathColors=c("red", "blue"))
}