TDM 10100: Project 11 — Fall 2026

  • Maps, Map-making, and Spatial Data in Python and R (e.g., Geopandas, ggplot, Leaflet, Plotly)

Project Objectives

Motivation: Spatial data (i.e., data about locations, maps, geographic data, etc.) are pervasive in data analysis.

Context: We explore making maps in R and Python

Scope: R, Python, geospatial data

Learning Objectives
  • Continue to learn about making maps from data

Please use 2 Cores for this project.

Please use the template found here, and the important information about project submissions here, when you are ready to submit your work.

Datasets

  • /anvil/projects/tdm/data/flights/subset/airports.csv

  • /anvil/projects/tdm/data/bay_area_bike_share/kaggle/station.csv

Questions

Back in Project 3, Question 4, we were introduced to making maps with Leaflet in R and with Geopandas in Python. Please thoroughly review Project 3, Question 4, before starting this project.

Question 1 (2 points)

Read the file /anvil/projects/tdm/data/flights/subset/airports.csv into R using read.csv not fread. The resulting data frame should have 3376 rows and 7 columns.

Use the built-in vector state.abb to find the number of rows from the data frame that correspond to airports located in the continental 48 states, i.e., not including Alaska or Hawaii. If you choose to add the airport in DC that is OK, but optional. Please be sure to explain your reasoning.

Create a new data frame that contains only the airports in the continental 48 states (and DC if you choose to add it too).

Deliverables
  • Find the number of rows from the data frame that correspond to airports located in the continental 48 states.

  • Create a new data frame that contains only the airports in the continental 48 states (and DC if you choose to add it too).

Question 2 (2 points)

Using the motivation from the mapping example from Project 3, Question 4, make a plot in R using Leaflet of the locations of the airports in the 48 continental states.

Because the airports are dense, you may want to use addCircleMarkers instead of addMarkers, and you may want to use radius=1.

Now make a plot in R using Leaflet of the locations of ONLY the airports that are in Indiana.

Deliverables
  • Make a plot in R using Leaflet of the locations of the airports in the 48 continental states.

  • Make a plot in R using Leaflet of the locations of ONLY the airports that are in Indiana.

Question 3 (2 points)

Repeat Question 1, but this time using Python instead of R. Because Python does not have a built-in list of states, it might help to use:

states = [ "AL", "AZ", "AR", "CA", "CO", "CT", "DC", "DE", "FL", "GA", "ID", "IL", "IN", "IA", "KS", "KY", "LA", "ME", "MD", "MA", "MI", "MN", "MS", "MO", "MT", "NE", "NV", "NH", "NJ", "NM", "NY", "NC", "ND", "OH", "OK", "OR", "PA", "RI", "SC", "SD", "TN", "TX", "UT", "VT", "VA", "WA", "WV", "WI", "WY" ]
Deliverables
  • Create a new Pandas data frame that contains only the airports in the continental 48 states (and DC if you choose to add it too).

Question 4 (2 points)

Make the two maps from Question 2 again, but this time with Geopandas in Python.

Deliverables
  • Make a plot in Python using Geopandas of the locations of the airports in the 48 continental states.

  • Make a plot in Python using Geopandas of the locations of ONLY the airports that are in Indiana.

Question 5 (2 points)

Use R to make a plot of the stations in the file:

/anvil/projects/tdm/data/bay_area_bike_share/kaggle/station.csv

(As in Question 2, because the stations are dense, you may want to use addCircleMarkers instead of addMarkers, and you may want to use radius=1.)

Also use Python to make a plot of the stations in the same file.

Deliverables
  • Use R to make a plot of the stations in the Bay Area Bike Share Kaggle Station file.

  • Use Python to make a plot of the stations in the Bay Area Bike Share Kaggle Station file.

Submitting your Work

Once you have completed the questions, save your Jupyter notebook. You can then download the notebook and submit it to Gradescope.

Items to submit
  • firstname_lastname_project11.ipynb

You must double check your .ipynb after submitting it in gradescope. A very common mistake is to assume that your .ipynb file has been rendered properly and contains your code, markdown, and code output even though it may not. Please take the time to double check your work. See here for instructions on how to double check this.

You will not receive full credit if your .ipynb file does not contain all of the information you expect it to, or if it does not render properly in Gradescope. Please ask a TA if you need help with this.