| title | emoji | colorFrom | colorTo | sdk | app_port | pinned | license |
|---|---|---|---|---|---|---|---|
MeteoSwiss Radar API |
🌦 |
blue |
indigo |
docker |
8000 |
false |
mit |
A standalone, containerized Python backend service that fetches, processes, and serves real-time Swiss precipitation radar data as standard GeoJSON.
Designed to power web applications and Home Assistant cards (e.g., meteoswiss-radar-card) by bridging the gap between the complex official MeteoSwiss data and web-friendly formats.
- HDF5 Processing: Natively handles MeteoSwiss ODIM HDF5 files (including DEFLATE compression) using
h5py. - Coordinate Transformation: Automatically projects Swiss grid coordinates (LV95 / CH1903+) to WGS84 for map compatibility.
- STAC API Integration: Polls the official MeteoSwiss STAC API for the latest precipitation data (
ch.meteoschweiz.ogd-radar-precip). - GeoJSON Output: Converts radar imagery into vectorized GeoJSON polygons (contours) for efficient rendering.
- Dockerized: Ready-to-run container image.
- Caching: Caches processed frames to minimize upstream bandwidth usage.
GET /versions.json: Returns the list of available timestamps (latest first).GET /radar/{timestamp}: Returns the radar data for a specific timestamp as a GeoJSON FeatureCollection.GET /precipitation/animation/...: Compatibility endpoints for the legacy simplified JSON format (if implemented).GET /docs: Interactive Swagger UI documentation.
-
Build the image:
docker build -t meteoswiss-radar-api . -
Run the container:
docker run -p 8000:8000 meteoswiss-radar-api
The API will be available at http://localhost:8000.
Requires Python 3.10+.
-
Install dependencies: Using
uv(recommended):uv sync
Or standard
pip:pip install -r requirements.txt
-
Run the server:
uv run python -m uvicorn app.main:app --reload
This service outputs standard GeoJSON. If you are developing a custom card (e.g., using Leaflet), you can consume the data directly.
Example Snippet:
/**
* Decodes the response from the Radar API.
* The API returns a standard GeoJSON FeatureCollection.
*/
export function decodeRadarData(data: any) {
if (data.type !== 'FeatureCollection') {
console.error('Invalid format: expected FeatureCollection');
return [];
}
// Return features directly for Leaflet's L.geoJSON()
return data;
}This project uses Open Data from MeteoSwiss. Source: MeteoSwiss
This project is licensed under the MIT License - see the LICENSE file for details.