added vegetation

This commit is contained in:
2026-06-23 13:57:33 +03:00
parent 0c9fc22d22
commit c7435955c3
32 changed files with 336 additions and 15 deletions
+43
View File
@@ -18,11 +18,23 @@
- GeoJSON coordinates: стандартный порядок `[lon, lat]`.
- Высота антенн: `height_agl`, метры над землёй.
- Частота в HTTP API: `frequency_mhz`.
- Лимит `samples` для profile/LOS/landcover: `2..2048`.
- DEM берётся из `DEM_PATH`, по умолчанию `/data/dem`.
- Buildings берутся из PostGIS table `buildings`.
- Vegetation loss считается по формуле P.833 с коэффициентами из env:
`P833_GAMMA_DB_PER_M` и `P833_MAX_ATTENUATION_DB`.
Ошибки возвращаются в machine-friendly формате:
```json
{
"detail": {
"code": "NOT_IMPLEMENTED",
"detail": "..."
}
}
```
## Health
### `GET /health`
@@ -51,6 +63,31 @@ curl -s http://localhost:5603/health | jq
curl -s http://localhost:5603/openapi.json | jq '{title: .info.title, paths: (.paths | keys)}'
```
## Data Status
### `GET /api/v1/status/data`
Проверяет, какие источники данных доступны API.
```bash
curl -s http://localhost:5603/api/v1/status/data | jq
```
Пример ответа:
```json
{
"dem": {"configured": true, "path": "/data/dem", "files_count": 36},
"landcover": {"configured": true, "path": "/data/landcover", "files_count": 6},
"canopy": {"configured": false, "path": "/data/canopy", "files_count": 0},
"postgis": {"configured": true, "buildings_count": 2688698, "error": null}
}
```
Ключевые вычислительные ответы (`terrain/profile`, `terrain/los`, `landcover/path`, `link/budget`)
также возвращают поле `data_sources`, чтобы интегратор видел, какие слои реально участвовали
в расчёте.
## Terrain
### `GET /api/v1/terrain/elevation`
@@ -486,6 +523,12 @@ docker compose exec -T postgis psql -U radio -d radio \
## Частые Диагностические Команды
Полный smoke-check:
```bash
API_BASE=http://localhost:5603 sh scripts/smoke_api.sh
```
Проверить, что API видит PostGIS:
```bash