[GRASS-SVN] r38154 -
grass/branches/develbranch_6/gui/wxpython/gui_modules
svn_grass at osgeo.org
svn_grass at osgeo.org
Thu Jul 2 04:19:27 EDT 2009
Author: martinl
Date: 2009-07-02 04:19:26 -0400 (Thu, 02 Jul 2009)
New Revision: 38154
Modified:
grass/branches/develbranch_6/gui/wxpython/gui_modules/mapdisp.py
grass/branches/develbranch_6/gui/wxpython/gui_modules/utils.py
Log:
wxGUI: fix proj statusbar resolution
Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/mapdisp.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/mapdisp.py 2009-07-02 08:08:55 UTC (rev 38153)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/mapdisp.py 2009-07-02 08:19:26 UTC (rev 38154)
@@ -886,9 +886,10 @@
proj, coord2 = utils.ReprojectCoordinates(coord = (region["e"], region["n"]),
projOut = projOut, flags = 'd')
if sel == 2:
- proj, coord3 = utils.ReprojectCoordinates(coord = (region["ewres"], region["nsres"]),
+ proj, coord3 = utils.ReprojectCoordinates(coord = (0.0, 0.0),
projOut = projOut, flags = 'd')
-
+ proj, coord4 = utils.ReprojectCoordinates(coord = (region["ewres"], region["nsres"]),
+ projOut = projOut, flags = 'd')
if coord1 and coord2:
if proj in ('ll', 'latlong', 'longlat'):
w, s = utils.Deg2DMS(coord1[0], coord1[1], string = False)
@@ -897,7 +898,9 @@
self.statusbar.SetStatusText("%s - %s, %s - %s" %
(w, e, s, n), 0)
else:
- ewres, nsres = utils.Deg2DMS(coord3[0], coord3[1], string = False)
+ ewres, nsres = utils.Deg2DMS(abs(coord3[0]) - abs(coord4[0]),
+ abs(coord3[1]) - abs(coord4[1]),
+ string = False, hemisphere = False)
self.statusbar.SetStatusText("%s - %s, %s - %s (%s, %s)" %
(w, e, s, n, ewres, nsres), 0)
else:
Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/utils.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/utils.py 2009-07-02 08:08:55 UTC (rev 38153)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/utils.py 2009-07-02 08:19:26 UTC (rev 38154)
@@ -264,12 +264,13 @@
return layers
-def Deg2DMS(lon, lat, string = True):
+def Deg2DMS(lon, lat, string = True, hemisphere = True):
"""!Convert deg value to dms string
@param lon longitude (x)
@param lat latitude (y)
@param string True to return string otherwise tuple
+ @param hemisphere print hemisphere
@return DMS string or tuple of values
@return empty string on error
@@ -290,18 +291,24 @@
flon += 360.0
# hemisphere
- if flat < 0.0:
+ if hemisphere:
+ if flat < 0.0:
+ flat = abs(flat)
+ hlat = 'S'
+ else:
+ hlat = 'N'
+
+ if flon < 0.0:
+ hlon = 'W'
+ flon = abs(flon)
+ else:
+ hlon = 'E'
+ else:
flat = abs(flat)
- hlat = 'S'
- else:
- hlat = 'N'
-
- if flon < 0.0:
- hlon = 'W'
flon = abs(flon)
- else:
- hlon = 'E'
-
+ hlon = ''
+ hlat = ''
+
slat = __ll_parts(flat)
slon = __ll_parts(flon)
More information about the grass-commit
mailing list