This notebook visualizes the world's airports, using data made available at http://ourairports.com/data/
import pandas as pd
# Download data and extract the columns we'll use
# full_data = pd.read_csv('http://ourairports.com/data/airports.csv')
# data = full_data[['type', 'latitude_deg', 'longitude_deg']]
# data.to_csv('../data/airports.csv', index=False)
data_url = '../data/airports.csv'
pd.read_csv(data_url).head()
| type | latitude_deg | longitude_deg | |
|---|---|---|---|
| 0 | heliport | 40.070801 | -74.933601 |
| 1 | small_airport | 59.949200 | -151.695999 |
| 2 | small_airport | 34.864799 | -86.770302 |
| 3 | heliport | 35.608700 | -91.254898 |
| 4 | small_airport | 34.305599 | -112.165001 |
from altair import Chart, X, Y, Axis, Scale
Chart(data_url).mark_circle(
size=1,
opacity=0.2
).encode(
x=X('longitude_deg:Q', axis=Axis(title=' ')),
y=Y('latitude_deg:Q', axis=Axis(title=' '),
scale=Scale(domain=(-60, 80))),
color='type:N',
).configure_cell(
width=800,
height=350
).configure_axis(
grid=False,
axisWidth=0,
tickWidth=0,
labels=False,
)