tools: steep_segments.js — extract steep bike-track sections to GPX + brouter

Two-pass extractor for the steepest sections of recorded bike tracks:
- pulls gps_points/gps_sessions from baldav.db (adb run-as), bike only;
- refines elevation online (--gpxz Copernicus GLO-30 with the user's key, deduped
  to ~33m cells + cached; falls back to open-elevation / on-device altitude_srtm_m);
- distance-window smoothing, grade over a configurable base (default 120m) with a
  GPS-gap guard, keeps the steepest base-window core per section (so a real steep
  core is not averaged away by a long gentle stretch), spatial de-dup of repeats;
- outputs steep_segments.gpx (named by grade/length/drop) + a brouter lonlats string.
Verified against two ground-truth spots the rider confirmed; open-elevation/SRTM30
flatten short steep features that GLO-30 resolves. Key + data stay gitignored.
This commit is contained in:
4aiman 2026-08-29 10:05:39 +03:00
commit 872e20a5b0

View file

@ -72,6 +72,7 @@
| `import_healthdiet.js` | Импорт health-diet.ru JSON в seed DB (авто-бамп версии) |
| `fetch_openfoodfacts.js` | OpenFoodFacts API |
| `fuzzy_dedup.js` | Нечёткая дедупликация |
| `steep_segments.js` | Крутые участки вело-треков → GPX + brouter lonlats. Тянет `baldav.db` (run-as), уточняет высоты online (`--gpxz` Copernicus GLO-30 по ключу, дедуп по ~33м ячейкам + кэш; иначе open-elevation), сглаживание по дистанции, уклон на базе (`120`) с барьером GPS-гэпов, окно-ядро steepest + пространственный дедуп мест. Флаги: `--gpxz/--local/--gps`, `--min= --drop= --dry` |
| `chzn_export.sh` | Экспорт анонимной сессии приложения «Честный знак» с рут-девайса (adb) → `chzn_session.json` для импорта в BalDav. Читает `com.qrbonus.xml`, проверяет живым `refresh` |
### Корень