From 41ff3673f2f2218cb38f0fb49befd7fa1ae2f663 Mon Sep 17 00:00:00 2001 From: Phil Crump Date: Tue, 10 Dec 2019 23:11:16 +0000 Subject: [PATCH] navparse.cc: Round observed azimuth & elevation values to 1 dp in 'svs.json' and 'observers.json' web data files. Closes #49. --- navparse.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/navparse.cc b/navparse.cc index b4966db..9f405d8 100644 --- a/navparse.cc +++ b/navparse.cc @@ -893,8 +893,8 @@ try nlohmann::json svo = nlohmann::json::object(); svo["db"] = iter->second.db; - svo["elev"] = iter->second.el; - svo["azi"] = iter->second.azi; + svo["elev"] = roundf(10.0*iter->second.el)/10.0; + svo["azi"] = roundf(10.0*iter->second.azi)/10.0; Point sat; @@ -910,8 +910,8 @@ try } if(sat.x) { Point our = g_srcpos[iter->first].pos; - svo["elev"] = getElevationDeg(sat, our); - svo["azi"] = getAzimuthDeg(sat, our); + svo["elev"] = roundf(10.0*getElevationDeg(sat, our))/10.0; + svo["azi"] = roundf(10.0*getAzimuthDeg(sat, our))/10.0; } @@ -1395,8 +1395,8 @@ try if(sat.x) { Point our = g_srcpos[pr.first].pos; - det["elev"] = getElevationDeg(sat, our); - det["azi"] = getAzimuthDeg(sat, our); + det["elev"] = roundf(10.0*getElevationDeg(sat, our))/10.0; + det["azi"] = roundf(10.0*getAzimuthDeg(sat, our))/10.0; } else det["elev"] = pr.second.el;