From 5e8483c94d2e452e2d5159224487af64d633bf60 Mon Sep 17 00:00:00 2001 From: Ian Renton Date: Sun, 28 Jul 2024 10:04:06 +0100 Subject: [PATCH 1/2] Set the SBS "isonground" flag to true for ships or aircraft with zero altitude. --- ais2adsb.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ais2adsb.py b/ais2adsb.py index 866b9f9..5a937ef 100755 --- a/ais2adsb.py +++ b/ais2adsb.py @@ -147,10 +147,11 @@ def sendBaseStation(decoded): dstr = now_utc.strftime("%Y/%m/%d") tstr = now_utc.strftime("%H:%M:%S.%f")[:-3] callsign = "V:" + ("00000" + str(decoded['mmsi']) )[-6:] + ground_flag = 1 if alt < 1 else 0 global client_socket - spos = f'MSG,2,1,0,{ICAO},1,{dstr},{tstr},{dstr},{tstr},,{alt},{speed},{heading},{lat},{lon},,,,,,0\n' + spos = f'MSG,2,1,0,{ICAO},1,{dstr},{tstr},{dstr},{tstr},,{alt},{speed},{heading},{lat},{lon},,,,,,{ground_flag}\n' scs = f'MSG,1,1,0,{ICAO},1,{dstr},{tstr},{dstr},{tstr},{callsign},,,,,,,,,,,\n' if client_socket == None: From 415a2f39c3dcc8dcf9cbb85d685b8feb0ea6a080 Mon Sep 17 00:00:00 2001 From: Ian Renton Date: Sun, 28 Jul 2024 10:25:00 +0100 Subject: [PATCH 2/2] Remove altitude field for ships to get grey icons in skyaware --- ais2adsb.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ais2adsb.py b/ais2adsb.py index 5a937ef..5bd2f8e 100755 --- a/ais2adsb.py +++ b/ais2adsb.py @@ -148,10 +148,11 @@ def sendBaseStation(decoded): tstr = now_utc.strftime("%H:%M:%S.%f")[:-3] callsign = "V:" + ("00000" + str(decoded['mmsi']) )[-6:] ground_flag = 1 if alt < 1 else 0 + alt_str = "" if alt < 1 else str(alt) global client_socket - spos = f'MSG,2,1,0,{ICAO},1,{dstr},{tstr},{dstr},{tstr},,{alt},{speed},{heading},{lat},{lon},,,,,,{ground_flag}\n' + spos = f'MSG,2,1,0,{ICAO},1,{dstr},{tstr},{dstr},{tstr},,{alt_str},{speed},{heading},{lat},{lon},,,,,,{ground_flag}\n' scs = f'MSG,1,1,0,{ICAO},1,{dstr},{tstr},{dstr},{tstr},{callsign},,,,,,,,,,,\n' if client_socket == None: