This project provides an interactive web application for visualizing geospatial data related to various disaster events. It utilizes data from the GeoNews database and allows users to filter and explore disaster events based on different criteria such as event type, date range, and location.
The project can be viewed at global-disaster-monitoring.streamlit.app.
- Interactive Map Visualization: View the geographical distribution of disaster events on an interactive map powered by Folium.
- Filtering Options: Filter disaster events based on event type and date range using Streamlit sidebar widgets.
- Insights and Analytics: Gain insights into disaster events through various interactive visualizations including charts, word clouds, and event counts over time.
- Key Events Marquee: Display a scrolling marquee in the sidebar showcasing recent key events with clickable links to more information.
- Dynamic Updates: The application dynamically updates visualizations and data based on user-selected filters.
This newapi script fetches live disaster-related news articles from the News API, extracts relevant information such as title, publication timestamp, source, and location, and inserts it into a MongoDB database for further analysis and visualization.
- Live Data Retrieval: Utilizes the News API to fetch recent news articles related to various disaster events such as earthquakes, floods, hurricanes, etc.
- Data Filtering: Filters out irrelevant articles and identifies the type of disaster event based on predefined keywords.
- Named Entity Recognition (NER): Uses spaCy to extract location entities (e.g., countries, regions, cities) from the article titles.
- Geocoding: Converts extracted location names into geographical coordinates (latitude and longitude) using the Geopy library.
- Data Cleaning: Removes duplicates, excludes irrelevant locations and URLs, and handles missing values.
- MongoDB Insertion: Inserts the cleaned and processed data into a MongoDB Atlas database collection.
- Clone the repository to your local machine.
- Make sure you have installed all required Python dependencies listed in the
requirements.txt
. - Obtain a News API key and set it as
NEWSAPI_KEY
variable. - Update the
exclude_locations
list to exclude any additional irrelevant locations. - Run the script
datacollection.py
. It will fetch live data, process it, and insert it into yourMongoDB database
. - Set up a MongoDB Atlas account and configure the connection URI in the
newsapi.py
file. - Run the Streamlit application using the command
streamlit run geonews.py
. - Access the application in your web browser at the provided URL.
- MongoDB Atlas URI: Replace
"YOUR_MONGODB_URI"
in the script with your actual MongoDB Atlas connection URI. - Database Name: The script assumes a database named
"GeoNews"
is available in your MongoDB Atlas cluster. You can change this as needed. - Collection Name: The script inserts data into a collection named
"disaster_info"
. Modify this collection name if required.
Ensure that your MongoDB Atlas cluster is properly configured to accept incoming connections from your Python script. Additionally, make sure your News API key is valid and has sufficient permissions to access news articles.
- Python
- Pandas
- Folium
- Streamlit
- Plotly
- Seaborn
- WordCloud
- MongoDB
1.mp4
2.mp4
Contributions are welcome! Feel free to open issues or pull requests for any improvements or bug fixes.