Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up airport maps #2634

Merged
merged 6 commits into from
Jul 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
"""
Locations of US Airports
========================
This is a layered geographic visualization that shows the positions of US
airports on a background of US states.
Grouped Points with Proportional Symbols Map
============================================
This is a layered geographic visualization that groups points by state.
"""
# category: maps
import altair as alt
Expand All @@ -20,7 +19,7 @@
height=300
).project('albersUsa')

# airport positions on background
# Airports grouped by state
points = alt.Chart(airports).transform_aggregate(
latitude='mean(latitude)',
longitude='mean(longitude)',
Expand Down
12 changes: 7 additions & 5 deletions altair/examples/airports.py → altair/examples/point_map.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
"""
Locations of US Airports
========================
This is a layered geographic visualization that shows the positions of US
airports on a background of US states.
Point map
=========
This is a layered map that shows the positions of airports on a background of U.S. states.
"""
# category: case studies
# category: maps
import altair as alt
from vega_datasets import data

# Read in points
airports = data.airports()

# Read in polygons from topojson
states = alt.topo_feature(data.us_10m.url, feature='states')

# US states background
Expand Down