library(raster)
library(tidyverse)
Overview
This map of Italy
shows the Alitalia Flights
, data is from openflights
.
Datasource:
- https://datacatalog.worldbank.org/search?fq=(geographical_extent%2Fcoverage%2Fany(geo:geo%2Fname%20eq%20%27Italy%27))%20and%20(Resources%2Fany(res:res%2Fformat%20eq%20%27TIFF%27))&q=
- https://datacatalog.worldbank.org/search/dataset/0038055/Derived-map-of-global-electricity-transmission-and-distribution-lines
- https://zenodo.org/record/3538890#.YZulSEbMJo4
- https://github.com/carderne/gridfinder
- https://rspatial.org/raster/spatial/8-rastermanip.html
- https://ec.europa.eu/eurostat/web/gisco/geodata/reference-data/transport-networks
<- rgeoboundaries::gb_adm0("italy") it
Italy Boundary Box:
IT: xmin: 6.626621 ymin: 35.49285 xmax: 18.52038 ymax: 47.09178
<- readRDS("~/Documents/R/R_general_resources/30DayMapChallenge/day20_movement/data/flights_fortified.rds")
flights_fortified
<-flights_fortified %>%
my_df filter(long>=6.626621 & long<=18.52038)%>%
filter(lat>=35.49285 & lat<=47.09178)
%>%count(name) my_df
<- my_df %>%
flights_points group_by(group) %>%
filter(row_number() == 1 | row_number() == n())
::agg_png(here::here("R_general_resources/30DayMapChallenge/day20_movement/movement_alitalia.png"),
raggres = 320, width = 12, height = 8, units = "in")
ggplot()+
geom_sf(data = it, fill = NA, color = "#295C9C", size = 0.4) +
geom_path(aes(long, lat, group = id, color = name),
alpha = 0.0, size = 0.0,
data = my_df) +
geom_path(aes(long, lat, group = id, color = name),
alpha = 0.2, size = 0.3, color = "#f9ba00",
data = my_df[my_df$name == "Alitalia", ]) +
geom_point(data = flights_points[flights_points$name == "Alitalia", ],
aes(long, lat), alpha = 0.8, size = 0.1, colour = "white") +
theme(panel.background = element_rect(fill = "#05050f", colour = "#05050f"),
panel.grid.major = element_blank(),
panel.grid.minor = element_blank(),
axis.title = element_blank(),
axis.text = element_blank(),
axis.ticks.length = unit(0, "cm"),
legend.position = "none") +
coord_sf()
dev.off()
library(cowplot)
<- ggdraw()+
final draw_image(here::here("day20_movement/movement_alitalia.png"),
x = 0.01, y = 0,width = 0.98) +
draw_label(label="Alitalia flights ",
x=0.5,y=0.12,size=25,color="white",fontface = "bold",
angle = 0) +
draw_text("Data: openflights - #30DayMapChallenge Day20 Movement\nInfographics: Federica Gazzelloni",
x=0.5,y=0.05,size=11,color="white")
# save final plot
::agg_png(here::here("day20_movement/movement2.png"),
raggres = 320, width = 12, height = 8, units = "in")
finaldev.off()