A newer version of the Gradio SDK is available:
5.44.1
metadata
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
- Adjust the resolution slider to control data density
- Toggle visualization layers:
- Wind Vectors: Arrows showing wind direction and speed
- Wind Speed Heatmap: Color-coded wind intensity
- Animated Particles: Dynamic wind flow visualization
- Click on wind vectors for detailed information
- 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, 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
chmod +x run.sh
./run.sh
Option 2: Manual setup
# 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
- Start the application using one of the methods above
- Open your browser to the provided URL (typically
http://localhost:7860
) - 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
- Explore the map by zooming and panning
- 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:
- Add real data sources in the
get_wind_data()
function - Customize map styling in the
create_wind_map()
function - Add new controls in the Gradio interface section
- Implement additional weather layers using Folium plugins
License
GPL-3.0 License - see the LICENSE file for details.