2005-12-09 03:42:04 +00:00
|
|
|
#!/usr/bin/python
|
2007-09-16 20:50:28 +00:00
|
|
|
#***************************************************************************
|
|
|
|
# test_export.py
|
|
|
|
# --------------------------------------
|
|
|
|
# Date : Sun Sep 16 12:34:29 AKDT 2007
|
|
|
|
# Copyright : (C) 2007 by Gary E. Sherman
|
|
|
|
# Email : sherman at mrcc dot com
|
|
|
|
#***************************************************************************
|
|
|
|
#* *
|
|
|
|
#* This program is free software; you can redistribute it and/or modify *
|
|
|
|
#* it under the terms of the GNU General Public License as published by *
|
|
|
|
#* the Free Software Foundation; either version 2 of the License, or *
|
|
|
|
#* (at your option) any later version. *
|
|
|
|
#* *
|
|
|
|
#***************************************************************************/
|
|
|
|
|
2005-12-09 03:42:04 +00:00
|
|
|
|
2007-11-16 22:51:49 +00:00
|
|
|
# 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
|
2005-12-09 03:42:04 +00:00
|
|
|
import ms_export
|
2007-11-16 22:51:49 +00:00
|
|
|
if len(sys.argv) == 3:
|
2007-11-17 00:22:11 +00:00
|
|
|
ex = ms_export.Qgis2Map(sys.argv[1], sys.argv[2])
|
2007-11-16 22:51:49 +00:00
|
|
|
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"
|