[GRASS-SVN] r37322 - grass/branches/releasebranch_6_4/gui/wxpython/gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Thu May 21 06:03:45 EDT 2009


Author: hamish
Date: 2009-05-21 06:03:45 -0400 (Thu, 21 May 2009)
New Revision: 37322

Modified:
   grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/mapdisp.py
Log:
fix bearing angle (compass convention; merge from devbr6)

Modified: grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/mapdisp.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/mapdisp.py	2009-05-21 10:03:09 UTC (rev 37321)
+++ grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/mapdisp.py	2009-05-21 10:03:45 UTC (rev 37322)
@@ -3806,8 +3806,9 @@
 
         if self.Map.projinfo['proj'] == 'xy' or 'degree' not in self.Map.projinfo['unit']:
             angle = int(math.degrees(math.atan2(north,east)) + 0.5)
-            angle = angle+90
-            if angle < 0: angle = 360+angle
+            angle = 180 - angle
+            if angle < 0:
+                angle = 360+angle
 
             mstring = 'segment = %s %s\ttotal distance = %s %s\tbearing = %d deg' \
                 % (strdist,dunits,strtotdist,tdunits,angle)



More information about the grass-commit mailing list