windmap / README.md
nakas's picture
Initial commit: Global Wind Map with real-time data visualization
16680d4
---
title: Global Wind Map
emoji: 🌍
colorFrom: blue
colorTo: green
sdk: gradio
sdk_version: 4.19.2
app_file: app.py
pinned: false
license: mit
---
# 🌍 Global Wind Map
A real-time interactive wind map showing global wind patterns using live data from the OpenMeteo API.
## 🌟 Features
- **🌬️ Real-Time Wind Data**: Live wind speed and direction from OpenMeteo API
- **πŸ—ΊοΈ Interactive Map**: Pan, zoom, and explore wind patterns worldwide
- **πŸ“Š Multiple Visualizations**:
- Animated wind particles
- Color-coded wind vectors
- Wind speed heatmap
- **πŸŽ›οΈ Customizable Display**:
- Adjustable data resolution
- Toggle different visualization layers
- Detailed wind information on hover
## πŸš€ Usage
1. Adjust the resolution slider to control data density
2. Toggle visualization layers:
- Wind Vectors: Arrows showing wind direction and speed
- Wind Speed Heatmap: Color-coded wind intensity
- Animated Particles: Dynamic wind flow visualization
3. Click on wind vectors for detailed information
4. Pan and zoom to explore different regions
## πŸ› οΈ Technical Details
- Built with Gradio and Folium
- Real-time data from OpenMeteo API
- Parallel data fetching for improved performance
- Adaptive resolution based on latitude
- Enhanced visualization with dynamic scaling
## πŸ“ Data Sources
Wind data is provided by the [OpenMeteo API](https://open-meteo.com/), offering:
- Current wind conditions
- Global coverage
- Regular updates
- Wind speed and direction at 10m height
## 🀝 Contributing
Feel free to open issues or submit pull requests to improve the visualization!
## Wind Pattern Simulation
The application currently displays simulated wind data with realistic patterns:
- **Trade Winds**: Easterly winds near the equator (-30Β° to 30Β° latitude)
- **Westerlies**: Westerly winds in mid-latitudes (30Β° to 60Β° and -60Β° to -30Β°)
- **Polar Winds**: Variable winds in polar regions
## Quick Start
### Option 1: Using the run script
```bash
chmod +x run.sh
./run.sh
```
### Option 2: Manual setup
```bash
# Create and activate virtual environment
python3 -m venv venv
source venv/bin/activate
# Install dependencies
pip install -r requirements.txt
# Run the application
python app.py
```
## Usage
1. **Start the application** using one of the methods above
2. **Open your browser** to the provided URL (typically `http://localhost:7860`)
3. **Adjust controls** in the left panel:
- **Data Resolution**: Lower values = more detail (but slower rendering)
- **Show Wind Vectors**: Toggle wind direction arrows
- **Show Wind Speed Heatmap**: Toggle colored wind speed overlay
4. **Explore the map** by zooming and panning
5. **Click on wind arrows** to see detailed wind information
## Wind Speed Legend
- πŸ”΅ **Blue (0-3 m/s)**: Light winds
- 🟒 **Green (3-7 m/s)**: Moderate winds
- 🟠 **Orange (7-12 m/s)**: Strong winds
- πŸ”΄ **Red (12+ m/s)**: Very strong winds
## Dependencies
- **gradio**: Web interface framework
- **folium**: Interactive mapping library
- **numpy**: Numerical computations
- **pandas**: Data manipulation
- **requests**: HTTP requests (for future API integration)
## Future Enhancements
The current version uses simulated data for demonstration. Planned improvements include:
- **Real Weather Data**: Integration with APIs like:
- OpenWeather API
- NOAA Global Forecast System
- European Centre for Medium-Range Weather Forecasts
- **Historical Data**: View wind patterns from past dates
- **Weather Forecast**: Show predicted wind patterns
- **Additional Layers**: Temperature, pressure, precipitation
- **Export Features**: Save maps as images or data
## Configuration
For production deployment on Hugging Face Spaces, the application will automatically start when the Space is loaded.
## Development
To extend the application:
1. **Add real data sources** in the `get_wind_data()` function
2. **Customize map styling** in the `create_wind_map()` function
3. **Add new controls** in the Gradio interface section
4. **Implement additional weather layers** using Folium plugins
## License
GPL-3.0 License - see the LICENSE file for details.