This project is a web-based application that visualizes real-time events sourced from NASA's EONET (Earth Observatory Natural Event Tracker) API. The application uses CesiumJS for 3D mapping and categorizes events such as wildfires, storms, and earthquakes, displaying them interactively on a world map.
- Event Categorization: Categorizes and visualizes events based on their type (e.g., Wildfires, Earthquakes).
- Real-Time Updates: Fetches data every 10 seconds to keep the event information up to date.
- Interactive Map: Displays events using CesiumJS with custom icons for different event types.
- Web API: Includes endpoints for fetching categorized events and last fetch timestamps.
- Frontend:
- HTML, JavaScript, CesiumJS
- Backend:
- Go (Gin Framework)
- Deployment:
- Docker
- Go: Ensure Go is installed (version 1.21+).
- Docker: Install Docker for containerized deployment.
- Token/Key: Get a token from Cesium and a key from Nasa (See step 2)
git clone https://github.com/Lach-dev/NaturalEvents.git
cd NaturalEventsReplace YOUR_API_KEY in main.go with your NASA EONET API key. Obtain one from NASA EONET.
Replace YOUR_ACCESS_TOKEN in index.html with your cesium token. Obtain one from Cesium.
go mod download
go run main.goAccess the app at http://localhost:8080.
docker build -t NaturalEvents .
docker run -p 8080:8080 NaturalEventsAccess the app at http://localhost:8080.
- GET
/api/categorize - Response:
{ "events": [ { "title": "Event Title", "categories": [{"title": "Category Title"}], "geometry": [{"coordinates": [longitude, latitude]}] } ] }
- GET
/api/lastFetchTime - Response:
{ "lastFetchTime": "2024-12-07T12:34:56Z" }
.
├── main.go # Backend implementation
├── index.html # Frontend with CesiumJS integration
├── static/ # Static assets (icons)
├── templates/ # HTML templates
├── Dockerfile # Docker build file
└── README.md # Project documentation
- Commented Code: Some functions (e.g.,
categorizeEvents) contain unused code. - Fetch Logic: The fetch interval might require adjustment for higher efficiency.
- Implement detailed caching strategies for event data.
- Add user interaction features like filtering events by category or location.
- Enhance error handling for API responses.
- NASA EONET API for providing real-time event data.
- CesiumJS for interactive 3D visualization.
- Gin Framework for the web API.
Feel free to contribute or report issues in the repository!