Skip to content
Permalink
Browse files
Fixed a crash in the plugin that occurs when the epsg code for a laye…
…r cannot be parsed

git-svn-id: http://svn.osgeo.org/qgis/trunk@13262 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
timlinux committed Apr 6, 2010
1 parent 8eb0318 commit 243e766
Showing 1 changed file with 6 additions and 2 deletions.
@@ -623,8 +623,12 @@ def writeMapLayers(self):


def getEpsg(self, lyr):
srs = lyr.getElementsByTagName('srs')[0].getElementsByTagName('spatialrefsys')[0]
return srs.getElementsByTagName('epsg')[0].childNodes[0].nodeValue.encode('utf-8')
try:
srs = lyr.getElementsByTagName('srs')[0].getElementsByTagName('spatialrefsys')[0]
return srs.getElementsByTagName('epsg')[0].childNodes[0].nodeValue.encode('utf-8')
except:
#Use 4326 as a sensible default if the above fails
return "4326"


def getPrimaryKey(self, layerId, tableName):

0 comments on commit 243e766

Please sign in to comment.