This Streamlit application displays earthquake data for a selected date range on an interactive map. The data is fetched from the USGS Earthquake Catalog API and can be filtered by magnitude and depth.
Select a date range to view earthquake data Filter earthquakes by minimum and maximum magnitude Filter earthquakes by minimum and maximum depth Interactive map displaying earthquake locations with color-coded markers based on magnitude Data table displaying details of the filtered earthquakes
To run this application, you need to have Python installed. Follow the steps below to set up and run the application:
Clone the repository:
git clone https://github.com/joncutrer/earthquakemap-streamlit.gitNavigate to the project directory:
cd interactive-earthquake-mapCreate a virtual environment:
python -m venv envActivate the virtual environment:
On Windows:
.\env\Scripts\activateOn macOS and Linux:
source env/bin/activateInstall the required packages:
pip install -r requirements.txtEnsure you are in the project directory and the virtual environment is activated.
Run the Streamlit application:
streamlit run earthquakemap_streamlit/streamlit_app.pyOpen your web browser and go to http://localhost:8501 to view the application.
Use the date pickers in the sidebar to select the start and end dates for the earthquake data you want to view.
Use the sliders in the sidebar to set the minimum and maximum magnitude and depth for the earthquakes. The map and data table will update automatically to reflect the filtered data.
The map displays earthquake locations with color-coded markers based on magnitude:
Silver: Magnitude < 1.8 Yellow: 1.8 ≤ Magnitude < 2.4 Orange: 2.4 ≤ Magnitude < 5 Red: 5 ≤ Magnitude < 7 Magenta: 7 ≤ Magnitude < 8.5 Purple: Magnitude ≥ 8.5 Click on a marker to view details about the earthquake, including magnitude and location.
Below the map, a data table displays detailed information about the filtered earthquakes, including the place, magnitude, time, longitude, latitude, and depth.
streamlit
pandas
requests
folium
streamlit-folium
Ensure these packages are listed in the requirements.txt file for easy installation.
Contributions are welcome! Please open an issue or submit a pull request with your changes.
This project is licensed under the MIT License. See the LICENSE file for more details.
