# RF Propagation API HTTP API for radio visibility, terrain profiles, Fresnel/LOS checks, link budget, viewshed, and coverage calculations. This repository follows `SPEC.md`. The first implementation pass creates the full service skeleton, pure RF/math kernels, and Copernicus DEM sampling. Integrations that require PostGIS data, pycraf, ITM/P.1812, landcover/canopy rasters, or external viewshed binaries are exposed through stable interfaces and return explicit "not implemented" responses until the corresponding data pipeline is connected. ## Layout - `api/` - FastAPI service, core calculations, service orchestration, tests. - `scripts/` - data bootstrap/import entry points. - `data/` - mounted data volume for DEM, landcover, and canopy rasters. - `docker-compose.yml` - local stack with API, worker, Redis, PostGIS, optional tiler. ## Quick Start ```bash cp .env.example .env docker compose up --build api redis postgis ``` The API is served at `http://localhost:8000`, with OpenAPI docs at `/docs`. ## DEM Bootstrap Download Copernicus DEM GLO-30 COG tiles for Saint Petersburg and Leningrad Oblast: ```bash python scripts/bootstrap_dem.py --bbox 27.3,58.4,35.8,61.4 --output-dir data/dem docker compose restart api worker ``` The API samples all `.tif`/`.tiff` files under `DEM_PATH` recursively. In Docker, the default `DEM_PATH=/data/dem` points to the mounted `./data/dem` directory. For local Python development: ```bash cd api python -m venv .venv source .venv/bin/activate pip install -e ".[dev]" python -m pytest python -m ruff check . ```