Skip to content
Permalink
Browse files

Fix for bug #636 in MapServer export script

Enhanced the text_export.py script.


git-svn-id: http://svn.osgeo.org/qgis/trunk@7429 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
gsherman
gsherman committed Nov 16, 2007
1 parent a5dfe88 commit 1a9cc04c96b267f5b073d721e91a208fbed86427
Showing with 18 additions and 6 deletions.
  1. +5 −1 tools/mapserver_export/ms_export.py
  2. +13 −5 tools/mapserver_export/test_export.py
@@ -559,7 +559,11 @@ def uniqueRenderer(self, layerNode, symbolNode):
for cls in classes:
self.outFile.write(" CLASS\n")

lower = cls.getElementsByTagName('lowervalue')[0].childNodes[0].nodeValue.encode('utf-8')
try:
lower = cls.getElementsByTagName('lowervalue')[0].childNodes[0].nodeValue.encode('utf-8')
except IndexError:
# set to blank in the case where the field used for rendering has no value
lower = ""

# If there's a label use it, otherwise autogenerate one
try:
@@ -15,9 +15,17 @@
#***************************************************************************/


# test script to export a sample QGIS project file to mapserver
# Test script to export a sample QGIS project file to mapserver
# No template of header/footer information is included in the map file
# To change units, image type, name, and dimensions, modify the ex.setOptions line
#
import sys
import ms_export
ex = ms_export.Qgis2Map('./test1.qgs', './test1.map')
ex.setOptions( 'Meters', 'JPEG', 'TestMap', '800', '600', '', '', '')

ex.writeMapFile()
if len(sys.argv) == 3:
ex = ms_export.Qgis2Map('/home/gsherman/town_test.qgs', './town_test.map')
ex.setOptions( 'Meters', 'JPEG', 'TestMap', '800', '600', '', '', '')
ex.writeMapFile()
else:
print "Test script to export a QGIS project file to a MapServer map file"
print "Specify the QGIS project file and a file name for the map file to be created:"
print " text_export.py my_qgis_project.qgs my_output_map.map"

0 comments on commit 1a9cc04

Please sign in to comment.
You can’t perform that action at this time.