Lab 10
Scripting (pt. 3): Spatial analysis
Part 1
Suppose you are working for the USGS on a seismology project and you are tasked with investigating earthquake risk for the state of Idaho. The USGS wants to know (a) how many earthquakes happened in the previous calendar year (e.g., Jan. - Dec.) inside and within 50km of the state, (b) the average magnitude of these earthquakes, (c) and the distribution of the number of seismic stations reporting.
You should complete the following steps (each is worth 1 pt.):
- Import modules.
- Read a states dataset and retrieve the appropriate earthquake dataset from the USGS (*note: use a magnitude of 2.5+ and restrict the initial dataset to just the United States).
- Create simple maps of the states dataset and the earthquake dataset to verify the integrity of the data.
- Transform the x,y data of both datasets into EPSG:2163.
- Subset the states dataset into just the state of Idaho.
- Create a 50km buffer around the state.
- Clip the earthquakes to just those within the buffer.
- Come up with the average magnitude of the earthquakes.
- Create a histogram of the number of seismic stations reporting.
Part 2
Suppose you are working for the Wisconsin DNR and your supervisor has given you a task on Trout Habitat Project Points in the state. The DNR is currently interested in bolstering conservation efforts around locations with riprap due to damage incurred by frequent storms. They want to know which habitat points are within a subset of counties – Vernon, Pepin, and Grant – so that you can begin prioritizing conservation efforts with local officials there.
You should complete the following steps (each is worth 1 pt. except where noted):
- Import modules.
- Read a counties dataset for the state of Wisconsin and the Trout Habitat Project Points dataset.
- Create simple maps of the counties dataset and the habitat point dataset to verify the integrity of the data.
- Transform the x,y data of both datasets into the official CRS for the state of Wisconsin (EPSG:3071).
- Subset the habitat points into just those which contain riprap (note, however, that there are several versions of this phrase present in the data including “riprap” and “Rip Rap”; 2 pts.).
- Subset the counties dataset into just Vernon, Pepin, and Grant counties.
- Clip the habitat points dataset by those counties.
- Print the display name of each habitat point.
- Create an aesthetically pleasing map of the habitat points of interest (2 pts.).
Additionally, code formatting and notebook presentation are worth 2 pts. total.