Earthquake Tracker
Example Output
Learning Outcomes
- Data Visualization
- Graph Traversal
- Sorting
- Conditions
Goals
The purpose of this assignment is to learn to
- Access and manipulate remote data through BRIDGES.
- Manipulate a
GraphAdjList
object.
- Display a location on a map.
- Optionally, perform basic graph operation (connected component)
You will be building a visualization that looks like in the figure above.
Description
Task
Grab recent earthquake data and build a graph representing the
locations of the 100 strongest earthquakes.
Basic
- Open your scaffolded code.
- Plug in your credentials.
- Get the most recent 10,000 earthquakes.
- Only retain the 100 highest magnitude earthquakes.
Place Earthquakes on the map
- Create a graph where each earthquake is a vertex.
- Add no edges for now.
- Pin earthquakes at their longitude and latitude.
- Tweak the appearance of vertices if you want (e.g., use a different symbols for earthquake in Hawaii or Alaska).
- Compile, run, and visualize.
Build a graph based on distances
- For each pair of earthquakes:
- Compute the distance using
calcDistance
.
- If the earthquakes are closer than 500km, add an edge between them.
- Compile, run, and visualize.
Show just the graph
- Deactivate the map overlay (already done in the scaffolding).
- Unpin the vertices by setting their location to infinity.
- Compile, run, and visualize.
(Optionally) Compute connected component
- unmark all vertices
- find an unmarked vertex
- flood its component and color its vertices
- go back to 2 as long as there are unmarked vertices
- Compile, run, and visualize.
Extensions
Help
For Java
Element documentation
GraphAdjListSimple documentation
GraphAdjList documentation
ElementVisualizer documentation
EarthquakeUSGS documentation
Bridges class documentation
For C++
Element documentation
GraphAdjList documentation
ElementVisualizer documentation
EarthquakeUSGS documentation
DataSource documentation
For Python
Element documentation
GraphAdjList documentation
ElementVisualizer documentation
EarthquakeUSGS documentation
LinkVisualizer documentation