From 3307261546b076baa79ea624de892f47da1d0cef Mon Sep 17 00:00:00 2001 From: antirez Date: Sat, 2 Feb 2013 14:40:58 +0100 Subject: [PATCH] CPR decoding: southern hemisphere coords are now handled correctly. --- dump1090.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dump1090.c b/dump1090.c index ee11512..801bd70 100644 --- a/dump1090.c +++ b/dump1090.c @@ -1704,8 +1704,8 @@ void decodeCPR(struct aircraft *a) { double rlat0 = AirDlat0 * (cprModFunction(j,60) + lat0 / 131072); double rlat1 = AirDlat1 * (cprModFunction(j,59) + lat1 / 131072); - if (rlat0 >= 90 && rlat0 <= 270) rlat0 -= 360; - if (rlat1 >= 90 && rlat1 <= 270) rlat1 -= 360; + if (rlat0 >= 270) rlat0 -= 360; + if (rlat1 >= 270) rlat1 -= 360; /* Check that both are in the same latitude zone, or abort. */ if (cprNLFunction(rlat0) != cprNLFunction(rlat1)) return;