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/qgis@13262 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
timlinux committed Apr 6, 2010
1 parent f126e37 commit 2064aa7a1d755eee794e21c806ab0f0340943da2
Showing with 6 additions and 2 deletions.
  1. +6 −2 python/plugins/mapserver_export/ms_export.py
@@ -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 2064aa7

Please sign in to comment.