diff --git a/API.md b/API.md index 393c4b9..11081d1 100644 --- a/API.md +++ b/API.md @@ -246,6 +246,8 @@ curl -s -X POST http://localhost:5603/api/v1/terrain/los \ "clearance_m": 11.28, "fresnel_radius_m": 11.9, "required_clearance_m": 7.14, + "fresnel_upper_60pct_m": 36.84, + "fresnel_upper_100pct_m": 41.6, "fresnel_lower_60pct_m": 22.56, "fresnel_lower_100pct_m": 17.8, "type": "terrain" @@ -257,8 +259,8 @@ curl -s -X POST http://localhost:5603/api/v1/terrain/los \ - `distance_m` по X. - `surface_m` как земля/DSM. - `path_height_m` как прямая TX-RX. -- `fresnel_lower_60pct_m` как нижняя граница требуемой свободной зоны. -- `fresnel_lower_100pct_m` как нижняя граница полной первой зоны Френеля. +- `fresnel_lower_60pct_m` и `fresnel_upper_60pct_m` как требуемая свободная зона. +- `fresnel_lower_100pct_m` и `fresnel_upper_100pct_m` как полная первая зона Френеля. - точки, где `clearance_m < required_clearance_m`, подсветить как нарушения. ## Buildings diff --git a/api/app/models/__pycache__/terrain.cpython-313.pyc b/api/app/models/__pycache__/terrain.cpython-313.pyc index 4cb4170..b18207c 100644 Binary files a/api/app/models/__pycache__/terrain.cpython-313.pyc and b/api/app/models/__pycache__/terrain.cpython-313.pyc differ diff --git a/api/app/models/terrain.py b/api/app/models/terrain.py index b7777a1..c52dace 100644 --- a/api/app/models/terrain.py +++ b/api/app/models/terrain.py @@ -70,6 +70,8 @@ class FresnelProfileSample(BaseModel): clearance_m: float fresnel_radius_m: float required_clearance_m: float + fresnel_upper_60pct_m: float + fresnel_upper_100pct_m: float fresnel_lower_60pct_m: float fresnel_lower_100pct_m: float type: Literal["terrain", "building", "canopy"] diff --git a/api/app/services/__pycache__/terrain.cpython-313.pyc b/api/app/services/__pycache__/terrain.cpython-313.pyc index f74b306..af2670c 100644 Binary files a/api/app/services/__pycache__/terrain.cpython-313.pyc and b/api/app/services/__pycache__/terrain.cpython-313.pyc differ diff --git a/api/app/services/terrain.py b/api/app/services/terrain.py index 712f68b..73f7bdb 100644 --- a/api/app/services/terrain.py +++ b/api/app/services/terrain.py @@ -130,6 +130,8 @@ def los( clearance_m=sample.clearance_m, fresnel_radius_m=sample.fresnel_radius_m, required_clearance_m=sample.required_clearance_m, + fresnel_upper_60pct_m=sample.path_height_m + sample.required_clearance_m, + fresnel_upper_100pct_m=sample.path_height_m + sample.fresnel_radius_m, fresnel_lower_60pct_m=sample.path_height_m - sample.required_clearance_m, fresnel_lower_100pct_m=sample.path_height_m - sample.fresnel_radius_m, type=sample.obstruction_type, diff --git a/api/tests/__pycache__/test_api.cpython-313-pytest-9.0.3.pyc b/api/tests/__pycache__/test_api.cpython-313-pytest-9.0.3.pyc index 7920574..5ba29df 100644 Binary files a/api/tests/__pycache__/test_api.cpython-313-pytest-9.0.3.pyc and b/api/tests/__pycache__/test_api.cpython-313-pytest-9.0.3.pyc differ diff --git a/api/tests/test_api.py b/api/tests/test_api.py index 9b4e649..ae13fff 100644 --- a/api/tests/test_api.py +++ b/api/tests/test_api.py @@ -86,6 +86,8 @@ def test_los_endpoint_returns_obstruction_summary_fields() -> None: "path_height_m", "fresnel_radius_m", "required_clearance_m", + "fresnel_upper_60pct_m", + "fresnel_upper_100pct_m", "fresnel_lower_60pct_m", "fresnel_lower_100pct_m", }.issubset(data["fresnel_profile"][0])