mirror of
https://github.com/zvx-echo6/central.git
synced 2026-06-10 11:54:37 +02:00
v0.10.2: monitoring-area bbox enforced at supervisor publish (was archive-only) (#PR_NUMBER_PLACEHOLDER)
Closes #86 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
1d5548c24c
commit
1bebf2570b
10 changed files with 590 additions and 145 deletions
|
|
@ -17,7 +17,7 @@ import pytest
|
|||
|
||||
from central.adapter import SourceAdapter
|
||||
from central.adapters.tomtom_flow import TomTomFlowAdapter
|
||||
from central.archive import _build_geom_sql
|
||||
from central.monitoring_area import build_geom_json
|
||||
from central.config_models import AdapterConfig
|
||||
from central.tomtom_flow_parse import (
|
||||
_local_to_lonlat,
|
||||
|
|
@ -83,10 +83,10 @@ def test_subject_for():
|
|||
def test_archive_prefers_geo_geometry():
|
||||
line = {"type": "LineString", "coordinates": [[-116.2, 43.6], [-116.1, 43.7]]}
|
||||
# geometry present -> returned verbatim (not bbox/centroid)
|
||||
out = _build_geom_sql({"geometry": line, "centroid": [-116.2, 43.6], "bbox": [-116.3, 43.5, -116.0, 43.8]})
|
||||
out = build_geom_json({"geometry": line, "centroid": [-116.2, 43.6], "bbox": [-116.3, 43.5, -116.0, 43.8]})
|
||||
assert json.loads(out) == line
|
||||
# no geometry -> falls back to centroid Point (regression guard)
|
||||
out2 = _build_geom_sql({"centroid": [-116.2, 43.6]})
|
||||
out2 = build_geom_json({"centroid": [-116.2, 43.6]})
|
||||
assert json.loads(out2)["type"] == "Point"
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue