[GRASS-SVN] r56160 - grass/branches/develbranch_6/gui/wxpython/location_wizard

svn_grass at osgeo.org svn_grass at osgeo.org
Wed May 8 03:50:22 PDT 2013


Author: hamish
Date: 2013-05-08 03:50:22 -0700 (Wed, 08 May 2013)
New Revision: 56160

Modified:
   grass/branches/develbranch_6/gui/wxpython/location_wizard/wizard.py
Log:
fix for traceback when specifying by proj4 terms (#1849) and when ellipsoid is used instead of datum (#1967)

Modified: grass/branches/develbranch_6/gui/wxpython/location_wizard/wizard.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/location_wizard/wizard.py	2013-05-07 23:50:59 UTC (rev 56159)
+++ grass/branches/develbranch_6/gui/wxpython/location_wizard/wizard.py	2013-05-08 10:50:22 UTC (rev 56160)
@@ -891,7 +891,7 @@
     def OnPageChanging(self, event):
         self.proj4params = ''
         proj = self.parent.projpage.p4proj
-                
+        
         if event.GetDirection():
             if self.datum not in self.parent.datums:
                 event.Veto()
@@ -994,7 +994,7 @@
         TitledPage.__init__(self, wizard, _("Specify ellipsoid"))
 
         self.parent = parent
-        
+
         self.ellipse = ''
         self.ellipsedesc = ''
         self.ellipseparams = ''
@@ -1342,9 +1342,9 @@
             if not self.epsgcode:
                 event.Veto()
                 return
-            else:              
+            else:
                 # check for datum transforms
-                ret = RunCommand('g.proj',
+		ret = RunCommand('g.proj',
                                  read = True,
                                  epsg = self.epsgcode,
                                  datumtrans = '-1',
@@ -1518,7 +1518,7 @@
                 
                 if dlg.ShowModal() == wx.ID_OK:
                     dtrans = dlg.GetTransform()
-                    if len(dtrans) == 0:
+                    if dtrans == '':
                         dlg.Destroy()
                         event.Veto()
                         return _('Datum transform is required.')
@@ -1637,14 +1637,19 @@
         global coordsys
         if coordsys in ('proj', 'epsg'):
             if coordsys == 'proj':
+                addl_opts = {}
+                dtover_flag = ''
+                if 'datum' == '':
+                    addl_opts['datum'] = '%s' % datum
+                    addl_opts['datumtrans'] = dtrans
+                    dtover_flag = 't'
                 ret, projlabel, err = RunCommand('g.proj',
-                                                 flags = 'jf',
+                                                 flags = 'jf' + dtover_flag,
                                                  proj4 = proj4string,
-                                                 datum = datum,
-                                                 datumtrans = dtrans,
                                                  location = location,
                                                  getErrorMsg = True,
-                                                 read = True)
+                                                 read = True,
+                                                 **addl_opts)
             elif coordsys == 'epsg':
                 ret, projlabel, err = RunCommand('g.proj',
                                                  flags = 'jf',



More information about the grass-commit mailing list