From cc7c30604574c9ea501444c50cd19fbcee5755f7 Mon Sep 17 00:00:00 2001 From: Stream Date: Sat, 2 May 2026 23:20:01 +0300 Subject: [PATCH] auto-sync: 2026-05-02 23:20:01 --- installer/registry.jsonl | 1 + tasks/enduro-trails/prototype/app.py | 24 +++++++++++++++--------- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/installer/registry.jsonl b/installer/registry.jsonl index 7739cca..60d8e96 100644 --- a/installer/registry.jsonl +++ b/installer/registry.jsonl @@ -15,3 +15,4 @@ {"ts":"2026-05-02T14:28:08Z","session":"20260426-113247_mva154_plane-nginx-ssl_5ad8","host":"mva154","status":"success","agent":"stream"} {"ts":"2026-05-02T14:36:28Z","session":"20260502-142827_mva154_enduro-trails-ycoord-fix_bcfb","host":"mva154","status":"success","agent":"stream","files":["/home/slin/openclaw/config/tasks/enduro-trails/prototype/docker-compose.yml"]} {"ts":"2026-05-02T14:44:02Z","session":"20260502-144136_mva154_enduro-quantize-fix_1482","host":"mva154","status":"success","agent":"stream","files":["/home/slin/openclaw/config/tasks/enduro-trails/prototype/app.py"]} +{"ts":"2026-05-02T20:19:00Z","session":"20260502-201802_mva154_enduro-zoom-consistency_7250","host":"mva154","status":"success","agent":"stream","files":["/home/slin/openclaw/config/tasks/enduro-trails/prototype/app.py"]} diff --git a/tasks/enduro-trails/prototype/app.py b/tasks/enduro-trails/prototype/app.py index c6ed151..7917344 100644 --- a/tasks/enduro-trails/prototype/app.py +++ b/tasks/enduro-trails/prototype/app.py @@ -196,15 +196,19 @@ async def get_tile(z: int, x: int, y: int): q_south = south - buf_y q_north = north + buf_y - # Лимиты по зуму - if z <= 6: - limit = 500 - elif z <= 8: - limit = 3000 - elif z <= 10: - limit = 8000 + # Минимальная длина трека по зуму — короткие треки не показываем на обзорных зумах. + # Это даёт консистентную картину: трек либо виден на всех зумах >= порога, либо нет. + # Значения подобраны эмпирически для ЦФО (~300км на z9, ~75км на z11). + if z <= 7: + min_length = 5000 # только треки длиннее 5 км + elif z <= 9: + min_length = 2000 # длиннее 2 км + elif z <= 11: + min_length = 500 # длиннее 500 м else: - limit = 15000 + min_length = 0 # все треки + + limit = 20000 # единый высокий лимит — фильтрация по длине важнее try: conn = get_db() @@ -215,8 +219,10 @@ async def get_tile(z: int, x: int, y: int): FROM trails WHERE min_lon <= ? AND max_lon >= ? AND min_lat <= ? AND max_lat >= ? + AND (length_m IS NULL OR length_m >= ?) + ORDER BY length_m DESC LIMIT ? - """, (q_east, q_west, q_north, q_south, limit)) + """, (q_east, q_west, q_north, q_south, min_length, limit)) trails_rows = cur.fetchall() cur.execute("""