::: {.cell hash='08_Maps_cache/revealjs/unnamed-chunk-80_b9c474fc1c9df63857dd3b1d36b0a404'}

```{.r .cell-code}
library(units)
all_airports <- read_sf("data/ne_10m_airports.shp") %>%
  st_transform(aea)
cities <- read_sf("data/italian-cities.shp") %>%
  st_transform(aea) %>%
  st_intersection(italy %>% st_transform(st_crs(all_airports)))

buffer <- st_buffer(all_airports, set_units(10, km)) %>% select(geometry)

italian_airports <- st_intersection(all_airports, st_transform(italy, st_crs(all_airports)))

close_cities <- st_intersection(cities, buffer)
close_cities
```

::: {.cell-output .cell-output-stdout}
```
Simple feature collection with 167 features and 122 fields
Geometry type: POINT
Dimension:     XY
Bounding box:  xmin: 594766.6 ymin: 4078086 xmax: 1319118 ymax: 4936020
Projected CRS: +proj=aea +lat_1=29.5 +lat_2=42.5
# A tibble: 167 × 123
   city       featurecla scalerank adm1_code diss_me iso_3166_2 wikipedia iso_a2
 * <chr>      <chr>          <int> <chr>       <int> <chr>      <chr>     <chr> 
 1 SANT'AGAT… Admin-1 s…         3 ITA-5413     5413 IT-CT      <NA>      IT    
 2 MISTERBIA… Admin-1 s…         3 ITA-5413     5413 IT-CT      <NA>      IT    
 3 MOTTA SAN… Admin-1 s…         3 ITA-5413     5413 IT-CT      <NA>      IT    
 4 ARSAGO SE… Admin-1 s…         3 ITA-5451     5451 IT-VA      <NA>      IT    
 5 BESNATE    Admin-1 s…         3 ITA-5451     5451 IT-VA      <NA>      IT    
 6 CARDANO A… Admin-1 s…         3 ITA-5451     5451 IT-VA      <NA>      IT    
 7 CASORATE … Admin-1 s…         3 ITA-5451     5451 IT-VA      <NA>      IT    
 8 FERNO      Admin-1 s…         3 ITA-5451     5451 IT-VA      <NA>      IT    
 9 GALLARATE  Admin-1 s…         3 ITA-5451     5451 IT-VA      <NA>      IT    
10 GOLASECCA  Admin-1 s…         3 ITA-5451     5451 IT-VA      <NA>      IT    
# ℹ 157 more rows
# ℹ 115 more variables: adm0_sr <int>, name <chr>, name_alt <chr>,
#   name_local <chr>, type <chr>, type_en <chr>, code_local <chr>,
#   code_hasc <chr>, note <chr>, hasc_maybe <chr>, region <chr>,
#   region_cod <chr>, provnum_ne <int>, gadm_level <int>, check_me <int>,
#   datarank <int>, abbrev <chr>, postal <chr>, area_sqkm <int>,
#   sameascity <int>, labelrank <int>, name_len <int>, mapcolor9 <int>, …
```
:::
:::