Live Demo Video: https://www.youtube.com/watch?v=Vpd3DNyJ0XE
A Python-based project that demonstrates how common sorting algorithms work — using real elevation data from NOAA’s global elevation dataset. This project visualizes the step-by-step sorting of elevation values sampled from randomly selected geographic coordinates, making it easier to understand how each algorithm functions.
Sorting algorithms can be hard to understand in the abstract. Raw elevation data is also tough to interpret on its own. This project addresses both problems by combining them: visualizing sorting algorithms using real-world elevation data.
- Help students better understand how sorting algorithms behave over time.
- Make sense of NOAA elevation data through color-coded visualizations.
- Provide interactive exploration of different sorting strategies.
- Retrieves elevation data for a random 5.3° x 5.3° bounding box using the BRIDGES elevation dataset.
- Visualizes a sample of the elevation data as a bar graph using
matplotlib. - Animates the sorting process using various algorithms:
- Bubble Sort
- Insertion Sort
- Selection Sort
- Merge Sort
- Heap Sort
- Quick Sort
- Displays the time taken to sort and the real-world location of the highest elevation point in the dataset using reverse geocoding.
- Allows selection of sorting algorithm from the command line.
- Data Collection: Random geographic coordinates are generated and used to pull elevation data from NOAA via the BRIDGES API.
- Flattening: The elevation grid is flattened into a list for sorting.
- Visualization: A
matplotlibanimation shows the sorting progress on a sample of the data. - Reverse Lookup: The highest elevation is reverse-geocoded to find its real-world location.
- Python 3.11+
matplotlib– for animation/visualizationnumpy– for efficient array manipulationrequests– for reverse geocoding lookupsbridges– for accessing NOAA elevation data
-
Clone the repository:
-
Create and activate a virtual environment:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
-
Run the visualizer:
python main.py quick # options: quick, heap, merge, bubble, insertion, selection