[GRASS-SVN] r67738 - grass-addons/grass7/gui/wxpython/wx.metadata/mdlib

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Feb 6 05:22:43 PST 2016


Author: krejcmat
Date: 2016-02-06 05:22:43 -0800 (Sat, 06 Feb 2016)
New Revision: 67738

Modified:
   grass-addons/grass7/gui/wxpython/wx.metadata/mdlib/mdgrass.py
Log:
addons wx.metadata: hide dependency for compiling

Modified: grass-addons/grass7/gui/wxpython/wx.metadata/mdlib/mdgrass.py
===================================================================
--- grass-addons/grass7/gui/wxpython/wx.metadata/mdlib/mdgrass.py	2016-02-06 12:26:46 UTC (rev 67737)
+++ grass-addons/grass7/gui/wxpython/wx.metadata/mdlib/mdgrass.py	2016-02-06 13:22:43 UTC (rev 67738)
@@ -40,7 +40,6 @@
 from subprocess import PIPE
 from datetime import date, datetime
 
-from osgeo import osr
 class GrassMD():
 
     '''
@@ -216,6 +215,12 @@
             return epsg
 
     def wkt2standards(self,prj_txt):
+        try:
+            from osgeo import osr
+        except Exception , e:
+            grass.message('GDAL python library is not installed: %s \n identifying of EPSG is disabled'%e)
+            return None
+
         srs = osr.SpatialReference()
         srs.ImportFromESRI([prj_txt])
         srs.AutoIdentifyEPSG()
@@ -223,7 +228,7 @@
             int(srs.GetAuthorityCode(None))
             return srs.GetAuthorityCode(None)
         except:
-            grass.message('Attemp of identifiyng EPSG is not successful')
+            grass.message('Attempt of identifying EPSG is not successful')
             return None
 
     def createTemporalISO(self, profile=None):



More information about the grass-commit mailing list