fix(map): geofence delete, vessel snapshots, sentinel cache, news briefs
Geofences could be drawn but not removed. VesselAPI Hormuz dots vanished
on restart and DVR skipped between the 5 daily polls. Sentinel-1 re-hit
STAC on every pan and often painted a neighbouring swath. Executive
briefs truncated; ticker stayed empty unless something was critical.
- Layer-panel list + polygon popup DELETE /api/geofences/{id}
- Persist VesselAPI polls to vessels (UTC-day purge, DVR as-of, boot hydrate)
- Cache Sentinel-1 by 2° cell; pick covering scene; clip Leaflet tiles
- Retry truncated LLM JSON; ticker falls back to medium/low; 3-min HUD poll
This commit is contained in:
parent
fdf5969e27
commit
c48788d4b6
20 changed files with 669 additions and 57 deletions
|
|
@ -7,6 +7,7 @@ from live_layers import (
|
|||
filter_points_bbox,
|
||||
parse_bbox,
|
||||
quantize_bbox,
|
||||
pick_sentinel_feature,
|
||||
rainviewer_tile_url,
|
||||
sign_cog_url,
|
||||
sentinel1_tile_url,
|
||||
|
|
@ -734,8 +735,9 @@ def test_fetch_sentinel1_vv_signed_tile_url(monkeypatch):
|
|||
post_url, post_json = calls[0][1], calls[0][2]
|
||||
assert post_url.endswith("/api/stac/v1/search")
|
||||
assert post_json["collections"] == ["sentinel-1-grd"]
|
||||
assert post_json["limit"] == 1
|
||||
assert post_json["limit"] >= 1
|
||||
assert post_json["sortby"][0]["direction"] == "desc"
|
||||
assert "bbox" in out
|
||||
|
||||
|
||||
def test_fetch_sentinel1_uses_hh_when_vv_missing(monkeypatch):
|
||||
|
|
@ -783,3 +785,22 @@ def test_fetch_sentinel1_none_when_no_vv_or_hh(monkeypatch):
|
|||
_cache.clear()
|
||||
|
||||
assert asyncio.run(fetch_sentinel1("-80,35,-79,36")) is None
|
||||
|
||||
|
||||
def test_pick_sentinel_feature_prefers_scene_covering_center():
|
||||
features = [
|
||||
{"id": "far", "bbox": [10.0, 10.0, 12.0, 12.0]},
|
||||
{"id": "cover", "bbox": [-80.5, 34.5, -78.5, 36.5]},
|
||||
{"id": "also-far", "bbox": [-10.0, 0.0, -8.0, 2.0]},
|
||||
]
|
||||
picked = pick_sentinel_feature(features, -79.5, 35.5)
|
||||
assert picked["id"] == "cover"
|
||||
|
||||
|
||||
def test_pick_sentinel_feature_falls_back_to_first_when_none_cover():
|
||||
features = [
|
||||
{"id": "a", "bbox": [10.0, 10.0, 12.0, 12.0]},
|
||||
{"id": "b", "bbox": [20.0, 20.0, 22.0, 22.0]},
|
||||
]
|
||||
assert pick_sentinel_feature(features, -79.5, 35.5)["id"] == "a"
|
||||
assert pick_sentinel_feature([], -79.5, 35.5) is None
|
||||
|
|
|
|||
Loading…
Reference in a new issue