Funknavigationsanlagen
Lauffähige Beispiele zur Abfrage von Funknavigationsanlagen über den Endpoint Funknavigationsanlagen: Overlays für Sichtflugkarten (Sectional Charts) in der Nähe eines Flughafens und Filterung von ILS-Anflügen.
| # | Frage | Verwendete Daten |
|---|---|---|
| 1 | Alle Navaids in der Nähe von KJFK für ein Sectional-Chart-Overlay auflisten | /navaids |
| 2 | Alle ILS-Anflüge an einem Flughafen finden | /navaids |
Voraussetzungen
x-api-key bei jeder Anfrage (Direktabonnement). Mehr erfahren →Installation
Die folgenden Skripte verwenden requests für API-Aufrufe und rich für die Terminalausgabe. Einmalig installieren:
pip install requests rich1. Navaids in der Nähe eines Flughafens für ein Sectional-Chart-Overlay
Frage: Alle Navaids in der Nähe von KJFK für ein Sectional-Chart-Overlay auflisten.
UKW-Navaids (VOR, VOR-DME, VORDME, ILS, LOC) liefern frequency_khz — teilen Sie den Wert durch 1.000, um den MHz-Wert zu erhalten, der auf Sectional Charts angegeben ist. NDB-Frequenzen bleiben in kHz. Die Ergebnisse werden nach Navaid-Typ gruppiert.
import os
from collections import defaultdict
import requests
from rich.console import Console
from rich.table import Table
console = Console()
HEADERS = {
"X-RapidAPI-Key": os.getenv("RAPIDAPI_KEY", "YOUR_RAPIDAPI_KEY"),
"X-RapidAPI-Host": "skylink-api.p.rapidapi.com",
}
BASE = "https://skylink-api.p.rapidapi.com"
VHF_TYPES = {"VOR", "VOR-DME", "VORDME", "ILS", "LOC", "DME", "TACAN"}
def fetch_navaids(airport: str) -> list[dict]:
r = requests.get(
f"{BASE}/navaids",
headers=HEADERS,
params={"airport": airport},
timeout=(10, 15),
)
if r.status_code == 404:
return []
r.raise_for_status()
return r.json().get("navaids") or []
def format_freq(navaid: dict) -> str:
freq_khz = navaid.get("frequency_khz")
if freq_khz is None:
return "—"
nav_type = navaid.get("type", "").upper()
if nav_type in VHF_TYPES:
return f"{freq_khz / 1000:.3f} MHz"
return f"{freq_khz:.0f} kHz"
def main() -> None:
navaids = fetch_navaids("KJFK")
if not navaids:
console.print("[yellow]No navaids found near KJFK.[/]")
return
grouped: dict[str, list[dict]] = defaultdict(list)
for nav in navaids:
grouped[nav.get("type", "UNKNOWN")].append(nav)
for nav_type in sorted(grouped):
table = Table(title=f"{nav_type} Navaids")
table.add_column("Ident", style="cyan", no_wrap=True)
table.add_column("Name")
table.add_column("Frequency")
table.add_column("Lat", justify="right")
table.add_column("Lon", justify="right")
for nav in grouped[nav_type]:
table.add_row(
nav.get("ident", "—"),
nav.get("name", "—"),
format_freq(nav),
f"{nav.get('latitude_deg', '—')}",
f"{nav.get('longitude_deg', '—')}",
)
console.print(table)
if __name__ == "__main__":
main()Ausgabe: Eine Tabelle pro Navaid-Typ (VOR, NDB, ILS usw.) mit Kennung, Name, Frequenz (MHz für UKW-Typen, kHz für NDB) und Koordinaten aller Navaids in der Nähe von KJFK.
2. ILS-Anflüge an einem Flughafen
Frage: Alle ILS-Anflüge an einem Flughafen finden (Filter nach Typ ILS).
Die Filterung mit type=[ILS](https://en.wikipedia.org/wiki/Instrument_landing_system) liefert ausschließlich Navaids des Instrumentenlandesystems. Kleine und regionale Flughäfen verfügen häufig über kein ILS — das Skript behandelt diesen Fall explizit.
import os
import requests
from rich.console import Console
from rich.table import Table
console = Console()
HEADERS = {
"X-RapidAPI-Key": os.getenv("RAPIDAPI_KEY", "YOUR_RAPIDAPI_KEY"),
"X-RapidAPI-Host": "skylink-api.p.rapidapi.com",
}
BASE = "https://skylink-api.p.rapidapi.com"
def fetch_ils(airport: str) -> list[dict]:
r = requests.get(
f"{BASE}/navaids",
headers=HEADERS,
params={"airport": airport, "type": "ILS"},
timeout=(10, 15),
)
if r.status_code == 404:
return []
r.raise_for_status()
return r.json().get("navaids") or []
def main() -> None:
icao = "EGLL"
ils_list = fetch_ils(icao)
if not ils_list:
console.print(
f"[yellow]No ILS approaches found at {icao}. "
"Small and regional airports often rely on RNAV/GPS approaches only.[/]"
)
return
table = Table(title=f"ILS Approaches — {icao}")
table.add_column("Ident", style="cyan", no_wrap=True)
table.add_column("Name")
table.add_column("Frequency (MHz)", justify="right")
table.add_column("Associated Airport")
for ils in ils_list:
freq_khz = ils.get("frequency_khz")
freq_str = f"{freq_khz / 1000:.2f}" if freq_khz is not None else "—"
table.add_row(
ils.get("ident", "—"),
ils.get("name", "—"),
freq_str,
ils.get("associated_airport", "—"),
)
console.print(table)
console.print(
f"\n[dim]{len(ils_list)} ILS approach(es) found. "
"Ident typically encodes the runway (e.g. I-27L → Runway 27L).[/]"
)
if __name__ == "__main__":
main()Ausgabe: Eine Tabelle der ILS-Anflüge an EGLL mit Kennung, Name, Localizer-Frequenz in MHz und zugehörigem Flughafen. Am Ende werden die Anzahl und ein Hinweis zur Dekodierung der Piste ausgegeben.