Skip to content

Commit c8c1029

Browse files
committed
fix(publishers): write full /systems/{id} URL in platform@link.href
All remaining publishers (aviation_wx, coops, nws, usgs_water, usgs_nims, usgs_eq, opensky) now build the full system URL from base_url rather than embedding the bare server-assigned UUID in platform@link.href. Pattern mirrors the fix already applied to ndbc (commit b662445). Affected functions: aviation_wx _deploy_station(station, system_server_id, base_url) coops _deploy_station(station, system_server_id, base_url) nws _deploy_station(station, system_server_id, base_url) usgs_water _deploy_station(station, system_server_id, base_url) usgs_nims _deploy_camera(cam, system_server_id, base_url) usgs_eq _deploy_feed(system_server_id, base_url) opensky _deploy_feed(config, system_server_id) [reads config['base_url']]
1 parent d512d60 commit c8c1029

7 files changed

Lines changed: 26 additions & 19 deletions

File tree

publishers/aviation_wx/bootstrap_aviation_wx.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -422,8 +422,9 @@ def _deploy_group() -> dict:
422422
}
423423

424424

425-
def _deploy_station(station: dict, system_server_id: str) -> dict:
425+
def _deploy_station(station: dict, system_server_id: str, base_url: str) -> dict:
426426
icao_id = station["icao_id"]
427+
system_href = f"{base_url.rstrip('/')}/systems/{system_server_id}"
427428
return {
428429
"type": "Feature",
429430
"geometry": {
@@ -437,7 +438,7 @@ def _deploy_station(station: dict, system_server_id: str) -> dict:
437438
"description": f"AviationWeather METAR station {icao_id} ({station['name']}) observation feed.",
438439
"validTime": [VALID_TIME_START, ".."],
439440
"platform@link": {
440-
"href": system_server_id,
441+
"href": system_href,
441442
"uid": _system_uid(icao_id),
442443
"title": f"AWX {icao_id}",
443444
},
@@ -537,7 +538,7 @@ def bootstrap(*, clean: bool = False, clean_only: bool = False,
537538
sys_id = system_ids.get(st["icao_id"])
538539
if sys_id or dry_run:
539540
ensure_deployment(base_url, auth, _deploy_uid(st["icao_id"]),
540-
_deploy_station(st, sys_id or "pending"),
541+
_deploy_station(st, sys_id or "pending", base_url),
541542
parent_id=group_id,
542543
dry_run=dry_run, stats=stats)
543544

publishers/coops/bootstrap_coops.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -599,8 +599,9 @@ def _deploy_group() -> dict:
599599
}
600600

601601

602-
def _deploy_station(station: dict, system_server_id: str) -> dict:
602+
def _deploy_station(station: dict, system_server_id: str, base_url: str) -> dict:
603603
station_id = station["id"]
604+
system_href = f"{base_url.rstrip('/')}/systems/{system_server_id}"
604605
return {
605606
"type": "Feature",
606607
"geometry": {
@@ -617,7 +618,7 @@ def _deploy_station(station: dict, system_server_id: str) -> dict:
617618
),
618619
"validTime": [VALID_TIME_START, ".."],
619620
"platform@link": {
620-
"href": system_server_id,
621+
"href": system_href,
621622
"uid": _system_uid(station_id),
622623
"title": f"CO-OPS {station_id}",
623624
},
@@ -717,7 +718,7 @@ def bootstrap(*, clean: bool = False, clean_only: bool = False,
717718
sys_id = system_ids.get(st["id"])
718719
if sys_id or dry_run:
719720
ensure_deployment(base_url, auth, _deploy_uid(st["id"]),
720-
_deploy_station(st, sys_id or "pending"),
721+
_deploy_station(st, sys_id or "pending", base_url),
721722
parent_id=group_id,
722723
dry_run=dry_run, stats=stats)
723724

publishers/nws/bootstrap_nws.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,8 @@ def _deploy_group_sml() -> dict:
537537
}
538538

539539

540-
def _deploy_station(station: dict, system_server_id: str) -> dict:
540+
def _deploy_station(station: dict, system_server_id: str, base_url: str) -> dict:
541+
system_href = f"{base_url.rstrip('/')}/systems/{system_server_id}"
541542
return {
542543
"type": "Feature",
543544
"geometry": {
@@ -558,7 +559,7 @@ def _deploy_station(station: dict, system_server_id: str) -> dict:
558559
],
559560
"validTime": [VALID_TIME_START, ".."],
560561
"platform@link": {
561-
"href": system_server_id,
562+
"href": system_href,
562563
"uid": _system_uid(station["id"]),
563564
"title": f"NWS {station['id']}",
564565
},
@@ -665,7 +666,7 @@ def bootstrap(*, clean: bool = False, clean_only: bool = False,
665666
# _deploy_station carries no SensorML-only fields under properties;
666667
# geo+json stub is sufficient.
667668
ensure_deployment(base_url, auth, _deploy_uid(st["id"]),
668-
_deploy_station(st, sys_id or "pending"),
669+
_deploy_station(st, sys_id or "pending", base_url),
669670
parent_id=group_id,
670671
dry_run=dry_run, stats=stats)
671672

publishers/opensky/bootstrap_opensky.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -500,6 +500,7 @@ def _deploy_root(config: dict) -> dict:
500500

501501
def _deploy_feed(config: dict, system_server_id: str) -> dict:
502502
bbox = config["bounding_box"]
503+
system_href = f"{config['base_url'].rstrip('/')}/systems/{system_server_id}"
503504
center_lon = (bbox["lomin"] + bbox["lomax"]) / 2
504505
center_lat = (bbox["lamin"] + bbox["lamax"]) / 2
505506

@@ -520,7 +521,7 @@ def _deploy_feed(config: dict, system_server_id: str) -> dict:
520521
),
521522
"validTime": [VALID_TIME_START, ".."],
522523
"platform@link": {
523-
"href": system_server_id,
524+
"href": system_href,
524525
"uid": SYSTEM_UID,
525526
"title": "OpenSky ADS-B Feed - Southern Arizona",
526527
},

publishers/usgs_eq/bootstrap_usgs_eq.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -414,8 +414,9 @@ def _deploy_root() -> dict:
414414
}
415415

416416

417-
def _deploy_feed(system_server_id: str) -> dict:
417+
def _deploy_feed(system_server_id: str, base_url: str) -> dict:
418418
"""Feed-level deployment node linked to the earthquake feed system."""
419+
system_href = f"{base_url.rstrip('/')}/systems/{system_server_id}"
419420
return {
420421
"type": "Feature",
421422
"geometry": {
@@ -435,7 +436,7 @@ def _deploy_feed(system_server_id: str) -> dict:
435436
),
436437
"validTime": [VALID_TIME_START, ".."],
437438
"platform@link": {
438-
"href": system_server_id,
439+
"href": system_href,
439440
"uid": SYSTEM_UID,
440441
"title": "USGS Earthquake Feed",
441442
},
@@ -513,7 +514,7 @@ def bootstrap(*, clean=False, clean_only=False, dry_run=False, force_sml=False):
513514
root_id = ensure_deployment(base_url, auth, DEPLOY_ROOT_UID, _deploy_root(),
514515
dry_run=dry_run, stats=stats)
515516
ensure_deployment(base_url, auth, DEPLOY_FEED_UID,
516-
_deploy_feed(sys_id or "pending"),
517+
_deploy_feed(sys_id or "pending", base_url),
517518
parent_id=root_id, dry_run=dry_run, stats=stats)
518519

519520
print_summary(stats, dry_run)

publishers/usgs_nims/bootstrap_usgs_nims.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -356,10 +356,11 @@ def _deploy_group() -> dict:
356356
}
357357

358358

359-
def _deploy_camera(cam: dict, system_server_id: str) -> dict:
359+
def _deploy_camera(cam: dict, system_server_id: str, base_url: str) -> dict:
360360
nwis_id = cam["nwisId"]
361361
cam_id = cam["camId"]
362362
station_name = cam.get("stationName", cam.get("camName", nwis_id))
363+
system_href = f"{base_url.rstrip('/')}/systems/{system_server_id}"
363364
return {
364365
"type": "Feature",
365366
"geometry": {
@@ -384,7 +385,7 @@ def _deploy_camera(cam: dict, system_server_id: str) -> dict:
384385
],
385386
"validTime": [VALID_TIME_START, ".."],
386387
"platform@link": {
387-
"href": system_server_id,
388+
"href": system_href,
388389
"uid": _system_uid(nwis_id),
389390
"title": f"USGS {nwis_id}",
390391
},
@@ -505,7 +506,7 @@ def bootstrap(*, clean: bool = False, clean_only: bool = False,
505506
sys_id = system_ids.get(nwis_id)
506507
if sys_id or dry_run:
507508
ensure_deployment(base_url, auth, _deploy_uid(nwis_id),
508-
_deploy_camera(cam, sys_id or "pending"),
509+
_deploy_camera(cam, sys_id or "pending", base_url),
509510
parent_id=group_id,
510511
dry_run=dry_run, stats=stats)
511512

publishers/usgs_water/bootstrap_usgs_water.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -717,8 +717,9 @@ def _deploy_group() -> dict:
717717
}
718718

719719

720-
def _deploy_station(station: dict, system_server_id: str) -> dict:
720+
def _deploy_station(station: dict, system_server_id: str, base_url: str) -> dict:
721721
nwis_id = station["nwisId"]
722+
system_href = f"{base_url.rstrip('/')}/systems/{system_server_id}"
722723
return {
723724
"type": "Feature",
724725
"geometry": {
@@ -753,7 +754,7 @@ def _deploy_station(station: dict, system_server_id: str) -> dict:
753754
],
754755
"validTime": [VALID_TIME_START, ".."],
755756
"platform@link": {
756-
"href": system_server_id,
757+
"href": system_href,
757758
"uid": _system_uid(nwis_id),
758759
"title": f"USGS {nwis_id}",
759760
},
@@ -863,7 +864,7 @@ def bootstrap(*, clean: bool = False, clean_only: bool = False,
863864
sys_id = system_ids.get(nwis_id)
864865
if sys_id or dry_run:
865866
ensure_deployment(base_url, auth, _deploy_uid(nwis_id),
866-
_deploy_station(st, sys_id or "pending"),
867+
_deploy_station(st, sys_id or "pending", base_url),
867868
parent_id=group_id,
868869
dry_run=dry_run, stats=stats)
869870

0 commit comments

Comments
 (0)