openwind-ci commited on
Commit
89382d3
·
1 Parent(s): 8727785

sync: github cc76c31

Browse files
vendor/api/src/openwind_api/routes/marine.py CHANGED
@@ -467,7 +467,8 @@ async def api_marc_coverage(request: Request) -> JSONResponse:
467
 
468
  Response::
469
 
470
- {"atlases": [{"name": "FINIS", "source": "marc",
 
471
  "bbox": [lat_min, lon_min, lat_max, lon_max],
472
  "cells": [[lat_min, lon_min, lat_max, lon_max], ...]}, ...]}
473
 
@@ -476,6 +477,13 @@ async def api_marc_coverage(request: Request) -> JSONResponse:
476
  diff two answers, and an empty list when the deployment ships without the
477
  dataset (the same state the overlay reports as ``covered: false``).
478
 
 
 
 
 
 
 
 
479
  **Filter on ``cells``, not on ``bbox``.** A point outside every ``cells``
480
  entry is a point the atlases refuse; ``bbox`` is only the outer envelope
481
  and it is far too coarse to decide with. MARC coverage polygons are
@@ -503,7 +511,11 @@ async def api_marc_coverage(request: Request) -> JSONResponse:
503
  atlases: list[dict[str, Any]] = [
504
  {
505
  "name": atlas.name,
506
- "source": "marc",
 
 
 
 
507
  "bbox": _widen_to_quantum(atlas.bbox),
508
  "cells": [_widen_to_quantum(cell) for cell in marc_cells.get(atlas.name, ())],
509
  }
 
467
 
468
  Response::
469
 
470
+ {"atlases": [{"name": "FINIS", "source": "marc", "label": "marc_finis_250m",
471
+ "rank": 2, "resolution_m": 250, "confidence": "high",
472
  "bbox": [lat_min, lon_min, lat_max, lon_max],
473
  "cells": [[lat_min, lon_min, lat_max, lon_max], ...]}, ...]}
474
 
 
477
  diff two answers, and an empty list when the deployment ships without the
478
  dataset (the same state the overlay reports as ``covered: false``).
479
 
480
+ ``source`` is the atlas's own short name (``marc``, ``bsh``, ``cmems``,
481
+ ``shom``); ``label`` is the ``current_source`` the overlay answers with
482
+ when that atlas wins, and ``rank`` then ``resolution_m`` is the order the
483
+ cascade tries the atlases holding a point, so a client can tell which
484
+ ones covered a point and were passed over. SHOM zones carry no rank: they
485
+ win within 0.5 km of a surveyed point, before any atlas.
486
+
487
  **Filter on ``cells``, not on ``bbox``.** A point outside every ``cells``
488
  entry is a point the atlases refuse; ``bbox`` is only the outer envelope
489
  and it is far too coarse to decide with. MARC coverage polygons are
 
511
  atlases: list[dict[str, Any]] = [
512
  {
513
  "name": atlas.name,
514
+ "source": atlas.source_short,
515
+ "label": atlas.source_label,
516
+ "rank": atlas.rank,
517
+ "resolution_m": atlas.resolution_m,
518
+ "confidence": atlas.confidence,
519
  "bbox": _widen_to_quantum(atlas.bbox),
520
  "cells": [_widen_to_quantum(cell) for cell in marc_cells.get(atlas.name, ())],
521
  }