Skip to content

Commit 48cf9d3

Browse files
author
gsherman
committed
Fix for bug #673
Fixed test script to actually use the cli args that are passed to it git-svn-id: http://svn.osgeo.org/qgis/trunk@7432 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent dabea3c commit 48cf9d3

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

tools/mapserver_export/ms_export.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,11 @@ def writeMapLayers(self):
343343
self.outFile.write(" TRANSPARENCY " + str(opacity) + "\n")
344344

345345
self.outFile.write(" PROJECTION\n")
346-
proj4Text = lyr.getElementsByTagName("proj4")[0].childNodes[0].nodeValue.encode('utf-8')
346+
# Get the destination srs for this layer and use it to create
347+
# the projection section
348+
destsrs = self.qgs.getElementsByTagName("destinationsrs")[0]
349+
proj4Text = destsrs.getElementsByTagName("proj4")[0].childNodes[0].nodeValue.encode('utf-8')
350+
# the proj4 text string needs to be reformatted to make mapserver happy
347351
self.outFile.write(self.formatProj4(proj4Text))
348352
self.outFile.write(" END\n")
349353
scaleDependent = lyr.getAttribute("scaleBasedVisibilityFlag").encode('utf-8')

tools/mapserver_export/test_export.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
import sys
2323
import ms_export
2424
if len(sys.argv) == 3:
25-
ex = ms_export.Qgis2Map('/home/gsherman/town_test.qgs', './town_test.map')
25+
ex = ms_export.Qgis2Map(sys.argv[1], sys.argv[2])
2626
ex.setOptions( 'Meters', 'JPEG', 'TestMap', '800', '600', '', '', '')
2727
ex.writeMapFile()
2828
else:

0 commit comments

Comments
 (0)