From bbe5bbd48d4eb07984e2deec36ab56f580c3dcb4 Mon Sep 17 00:00:00 2001 From: Volker Mayer Date: Wed, 26 Sep 2018 18:12:41 +0200 Subject: [PATCH] _latlon: Fix conversion from DMS to decimal degrees --- LINZ/Geodetic/Sinex.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/LINZ/Geodetic/Sinex.py b/LINZ/Geodetic/Sinex.py index 411e0fc..767ccd2 100644 --- a/LINZ/Geodetic/Sinex.py +++ b/LINZ/Geodetic/Sinex.py @@ -473,11 +473,14 @@ def _wantId( self, ptid ): def _latlon( self, llstring ): negative='-' in llstring - llstring.replace('-',' ') + llstring = llstring.replace('-',' ') d,m,s=(float(x) for x in llstring.split()) angle=d+m/60.0+s/3600.0 if negative: angle=-angle + + if angle > 180.0: + angle = angle - 360.0 return angle def _scanSiteId( self, section ):