[GRASS-SVN] r65925 - grass-addons/grass7/general/g.proj.identify

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Aug 13 02:47:57 PDT 2015


Author: krejcmat
Date: 2015-08-13 02:47:56 -0700 (Thu, 13 Aug 2015)
New Revision: 65925

Modified:
   grass-addons/grass7/general/g.proj.identify/g.proj.identify.py
Log:
g.proj.identify addons: fix EPSG parser

Modified: grass-addons/grass7/general/g.proj.identify/g.proj.identify.py
===================================================================
--- grass-addons/grass7/general/g.proj.identify/g.proj.identify.py	2015-08-13 09:24:49 UTC (rev 65924)
+++ grass-addons/grass7/general/g.proj.identify/g.proj.identify.py	2015-08-13 09:47:56 UTC (rev 65925)
@@ -54,10 +54,12 @@
                quiet=True,
                stdout_=PIPE)
     proj=proj.outputs.stdout
-    for line in proj.splitlines():
+    lines=proj.splitlines()
+    for e,line in enumerate(lines):
         if 'EPSG' in line:
-            epsg=line.split(':')[1].replace(' ','')
+            epsg=lines[e+1].split(':')[1].replace(' ','')
             print('epsg=%s' % epsg)
+            return
     try:
         proj=Module('g.proj',
                flags='wf',



More information about the grass-commit mailing list