[QGIS Commit] r12120 - trunk/qgis/python/plugins/mapserver_export
svn_qgis at osgeo.org
svn_qgis at osgeo.org
Sun Nov 15 07:42:38 EST 2009
Author: rduivenvoorde
Date: 2009-11-15 07:42:37 -0500 (Sun, 15 Nov 2009)
New Revision: 12120
Modified:
trunk/qgis/python/plugins/mapserver_export/__init__.py
trunk/qgis/python/plugins/mapserver_export/mapserverexport.py
trunk/qgis/python/plugins/mapserver_export/ms_export.py
trunk/qgis/python/plugins/mapserver_export/qgsmapserverexportbase.ui
Log:
New, smaller dialog. More defaults, checks and failovers. Merged work of Stephan Meissl
Modified: trunk/qgis/python/plugins/mapserver_export/__init__.py
===================================================================
--- trunk/qgis/python/plugins/mapserver_export/__init__.py 2009-11-15 12:28:53 UTC (rev 12119)
+++ trunk/qgis/python/plugins/mapserver_export/__init__.py 2009-11-15 12:42:37 UTC (rev 12120)
@@ -24,7 +24,7 @@
def description():
return "Export a saved QGIS project file to a MapServer map file"
def version():
- return "Version 0.4"
+ return "Version 0.4.1"
def qgisMinimumVersion():
return "1.0"
def authorName():
Modified: trunk/qgis/python/plugins/mapserver_export/mapserverexport.py
===================================================================
--- trunk/qgis/python/plugins/mapserver_export/mapserverexport.py 2009-11-15 12:28:53 UTC (rev 12119)
+++ trunk/qgis/python/plugins/mapserver_export/mapserverexport.py 2009-11-15 12:42:37 UTC (rev 12120)
@@ -16,7 +16,7 @@
* (at your option) any later version. *
* *
***************************************************************************/
-/* Adapted by Erik van de Pol, B3Partners BV. */
+/* Adapted by Erik van de Pol */
"""
# Import the PyQt and QGIS libraries
from PyQt4.QtCore import *
@@ -55,6 +55,7 @@
else:
return QIcon()
+
def initGui(self):
# Create action that will start plugin configuration
self.action = QAction(self.getThemeIcon("mapserver_export.png"), \
@@ -63,26 +64,31 @@
# connect the action to the run method
QObject.connect(self.action, SIGNAL("activated()"), self.run)
QObject.connect(self.iface, SIGNAL("currentThemeChanged ( QString )"), self.setCurrentTheme)
-
# Add toolbar button and menu item
self.iface.addToolBarIcon(self.action)
self.iface.addPluginToMenu("&MapServer Export...", self.action)
+
def unload(self):
# Remove the plugin menu item and icon
self.iface.removePluginMenu("&MapServer Export...",self.action)
self.iface.removeToolBarIcon(self.action)
+
# run method that performs all the real work
def run(self):
# create and show the MapServerExport dialog
self.dlg = MapServerExportDialog()
- #dlg.setupUi(self)
+
+ # TODO: should come from settings
+ self.dlg.ui.txtMapFilePath.setText('/usr/lib/cgi-bin/kaas.map')
+ # project defaults to current instance
project = QgsProject.instance()
+
# question: save project on loading export dialog?
if project.isDirty():
- shouldSave = QMessageBox.question(None,
+ shouldSave = QMessageBox.question(self.dlg,
"Save?",
"Save project to \"" + project.fileName() + "\" before exporting? Only the last saved version of your project will be exported.",
QMessageBox.Yes,
@@ -97,14 +103,31 @@
".",
"QGIS Project Files (*.qgs)",
"Filter list for selecting files from a dialog box")
- project.setFileName(saveAsFileName)
- project.write()
+ # Check that a file was selected
+ if saveAsFileName.size() == 0:
+ QMessageBox.warning(self.dlg, "Not saved!", "QGis project file not saved because no file name was given.")
+ # fall back to using current project if available
+ self.dlg.ui.txtQgisFilePath.setText(project.fileName())
+ else:
+ project.setFileName(saveAsFileName)
+ project.write()
+ else:
+ project.write()
elif shouldSave == QMessageBox.Cancel:
return # do not show the export dialog
self.dlg.ui.txtQgisFilePath.setText(project.fileName())
+
+ # set title, or set default one if none available
+ title = project.title()
+ if title == "":
+ title = "QGisGeneratedMapfile"
self.dlg.ui.txtMapName.setText(project.title())
-
+
+ if self.dlg.ui.txtMapFilePath.text().size() == 0:
+ btnOk = self.dlg.ui.buttonBox.button(QDialogButtonBox.Ok)
+ btnOk.setEnabled(False)
+
# TODO: fetch unit used from QSettings
# TODO: fetch width/height guess from QSettings:
@@ -119,94 +142,149 @@
#self.dlg.ui.spinBoxScale.setValue(scale.toInt()[0])
QObject.connect(self.dlg.ui.btnChooseFile, SIGNAL("clicked()"), self.setSaveFile)
+ QObject.connect(self.dlg.ui.txtMapFilePath, SIGNAL("textChanged(QString)"), self.mapfileChanged)
QObject.connect(self.dlg.ui.btnChooseProjectFile, SIGNAL("clicked()"), self.setProjectFile)
QObject.connect(self.dlg.ui.chkExpLayersOnly, SIGNAL("clicked(bool)"), self.toggleLayersOnly)
+ QObject.connect(self.dlg.ui.checkBoxCurrentProject, SIGNAL("clicked(bool)"), self.toggleUseCurrentProject)
QObject.connect(self.dlg.ui.btnChooseFooterFile, SIGNAL("clicked()"), self.setFooterFile)
QObject.connect(self.dlg.ui.btnChooseHeaderFile, SIGNAL("clicked()"), self.setHeaderFile)
QObject.connect(self.dlg.ui.btnChooseTemplateFile, SIGNAL("clicked()"), self.setTemplateFile)
-
+ QObject.connect(self.dlg.ui.buttonBox, SIGNAL("accepted()"), self.ok_clicked)
+
self.dlg.show()
- result = self.dlg.exec_()
- # See if OK was pressed
- if result == 1:
- # get the settings from the dialog and export the map file
- print "Creating exporter using %s and %s" % (self.dlg.ui.txtQgisFilePath.text(), self.dlg.ui.txtMapFilePath.text())
- exporter = Qgis2Map(unicode(self.dlg.ui.txtQgisFilePath.text()), unicode(self.dlg.ui.txtMapFilePath.text()))
- print "Setting options"
- exporter.setOptions(
- unicode(self.dlg.ui.txtMapServerUrl.text()),
- unicode(self.dlg.ui.cmbMapUnits.itemData( self.dlg.ui.cmbMapUnits.currentIndex() ).toString()),
- unicode(self.dlg.ui.cmbMapImageType.currentText()),
- unicode(self.dlg.ui.txtMapName.text()),
- unicode(self.dlg.ui.txtMapWidth.text()),
- unicode(self.dlg.ui.txtMapHeight.text()),
- unicode(self.dlg.ui.txtWebTemplate.text()),
- unicode(self.dlg.ui.txtWebFooter.text()),
- unicode(self.dlg.ui.txtWebHeader.text()),
- self.dlg.ui.checkBoxDump.isChecked(),
- self.dlg.ui.checkBoxForce.isChecked(),
- self.dlg.ui.checkBoxAntiAlias.isChecked(),
- self.dlg.ui.checkBoxPartials.isChecked(),
- self.dlg.ui.chkExpLayersOnly.isChecked(),
- unicode(self.dlg.ui.txtFontsetPath.text()),
- unicode(self.dlg.ui.txtSymbolsetPath.text())
- )
- print "Calling writeMapFile"
+ def ok_clicked(self):
+ # Check if map file name is provided
+ if self.dlg.ui.txtMapFilePath.text().size() == 0:
+ saveAsFileName = QFileDialog.getSaveFileName(self.dlg,
+ "Please choose to save map file as...",
+ ".",
+ "Map files (*.map)",
+ "Filter list for selecting files from a dialog box")
+ # Check that a file was selected
+ if saveAsFileName.size() == 0:
+ QMessageBox.warning(self.dlg, "Not saved!", "Map file not saved because no file name was given")
+ return
+ else:
+ self.dlg.ui.txtMapFilePath.setText(saveAsFileName)
+ self.saveMapFile()
+
+ # Check if map file exists and we should overwrite it
+ elif QFile(self.dlg.ui.txtMapFilePath.text()).exists():
+ shouldOverwrite = QMessageBox.question(self.dlg,
+ "Overwrite?",
+ "Map file \"" + self.dlg.ui.txtMapFilePath.text() + "\" already exists. \nShould we overwrite it?",
+ QMessageBox.Yes,
+ QMessageBox.Cancel
+ )
+ if shouldOverwrite == QMessageBox.Yes:
+ self.saveMapFile()
+ elif shouldOverwrite == QMessageBox.Cancel:
+ return
+
+ else:
+ self.saveMapFile()
+
+ def toggleUseCurrentProject(self, boolUseCurrent):
+ self.dlg.ui.txtQgisFilePath.setEnabled(not boolUseCurrent)
+ self.dlg.ui.btnChooseProjectFile.setEnabled(not boolUseCurrent)
+ if boolUseCurrent:
+ if self.dlg.ui.txtQgisFilePath.text().size() == 0:
+ # reload path of current project
+ self.dlg.ui.txtQgisFilePath.setText(QgsProject.instance().fileName())
+ # check if current project is saved and/or dirty? Nope: will be done when Ok clicked
+ else:
+ # open dialog to choose project file
+ self.setProjectFile()
+
+
+
+ def saveMapFile(self):
+ # get the settings from the dialog and export the map file
+ print "Creating exporter using %s and %s" % (self.dlg.ui.txtQgisFilePath.text(), self.dlg.ui.txtMapFilePath.text())
+ if self.dlg.ui.txtQgisFilePath.text().size() == 0:
+ saveAsFileName = QFileDialog.getSaveFileName(self.dlg,
+ "Please choose to save QGis project file as...",
+ ".",
+ "QGis files (*.qgs)",
+ "Filter list for selecting files from a dialog box")
+ # Check that a file was selected
+ if saveAsFileName.size() == 0:
+ QMessageBox.warning(self.dlg, "Not saved!", "QGis project file not saved because no file name was given")
+ return
+ else:
+ self.dlg.ui.txtQgisFilePath.setText(saveAsFileName)
+
+ exporter = Qgis2Map(unicode(self.dlg.ui.txtMapFilePath.text()))
+
+ # Parse qgis project file and check success
+ if not(exporter.setQgsProject(self.dlg.ui.txtQgisFilePath.text())):
+ QMessageBox.warning(self.dlg, "Not saved!", "File not saved because no valid qgis project file was given.")
+ return
+
+ self.dlg.hide()
+ print "Setting options"
+ exporter.setOptions(
+ unicode(self.dlg.ui.txtMapServerUrl.text()),
+ unicode(self.dlg.ui.cmbMapUnits.itemData( self.dlg.ui.cmbMapUnits.currentIndex() ).toString()),
+ unicode(self.dlg.ui.cmbMapImageType.currentText()),
+ unicode(self.dlg.ui.txtMapName.text()),
+ unicode(self.dlg.ui.txtMapWidth.text()),
+ unicode(self.dlg.ui.txtMapHeight.text()),
+ unicode(self.dlg.ui.txtWebTemplate.text()),
+ unicode(self.dlg.ui.txtWebHeader.text()),
+ unicode(self.dlg.ui.txtWebFooter.text()),
+ self.dlg.ui.checkBoxDump.isChecked(),
+ self.dlg.ui.checkBoxForce.isChecked(),
+ self.dlg.ui.checkBoxAntiAlias.isChecked(),
+ self.dlg.ui.checkBoxPartials.isChecked(),
+ self.dlg.ui.chkExpLayersOnly.isChecked(),
+ unicode(self.dlg.ui.txtFontsetPath.text()),
+ unicode(self.dlg.ui.txtSymbolsetPath.text())
+ )
+ print "Calling writeMapFile"
+ try:
result = exporter.writeMapFile()
- QMessageBox.information(None, "MapServer Export Results", result)
+ except Exception, err:
+ QMessageBox.information(self.dlg, "MapServer Export Error", str(err))
+ return
+
+ QMessageBox.information(self.dlg, "MapServer Export Results", result)
+ def mapfileChanged(self, text):
+ # Enable OK button
+ btnOk = self.dlg.ui.buttonBox.button(QDialogButtonBox.Ok)
+ if text.size() > 0:
+ btnOk.setEnabled(True)
+ else:
+ btnOk.setEnabled(False)
+
def setSaveFile(self):
mapFile = QFileDialog.getSaveFileName(self.dlg, "Name for the map file", \
".", "MapServer map files (*.map);;All files (*.*)","Filter list for selecting files from a dialog box")
self.dlg.ui.txtMapFilePath.setText(mapFile)
-
+
def setProjectFile(self):
- qgisProjectFile = QFileDialog.getOpenFileName(self.dlg, "Choose the QGIS Project file", \
- ".", "QGIS Project Files (*.qgs);;All files (*.*)", "Filter list for selecting files from a dialog box")
+ qgisProjectFile = QFileDialog.getOpenFileName(self.dlg, "Choose a QGIS Project file", \
+ ".", "QGIS Project Files (*.qgs);;All files (*.*)", "Filter list for selecting files from a dialog box")
self.dlg.ui.txtQgisFilePath.setText(qgisProjectFile)
def setTemplateFile(self):
- templateFile = QFileDialog.getOpenFileName(self.dlg,
- "Choose the MapServer template file",
- ".",
- "All files (*.*)",
- "Filter list for selecting files from a dialog box")
+ templateFile = QFileDialog.getOpenFileName(self.dlg, "Choose the MapServer template file", \
+ ".", "All files (*.*)", "Filter list for selecting files from a dialog box")
self.dlg.ui.txtWebTemplate.setText(templateFile)
def setHeaderFile(self):
- headerFile = QFileDialog.getOpenFileName(self.dlg,
- "Choose the MapServer header file",
- ".",
- "All files (*.*)",
- "Filter list for selecting files from a dialog box")
+ headerFile = QFileDialog.getOpenFileName(self.dlg, "Choose the MapServer header file", \
+ ".", "All files (*.*)", "Filter list for selecting files from a dialog box")
self.dlg.ui.txtWebHeader.setText(headerFile)
def setFooterFile(self):
- footerFile = QFileDialog.getOpenFileName(self.dlg,
- "Choose the MapServer footer file",
- ".",
- "All files (*.*)",
- "Filter list for selecting files from a dialog box")
+ footerFile = QFileDialog.getOpenFileName(self.dlg, "Choose the MapServer footer file", \
+ ".", "All files (*.*)", "Filter list for selecting files from a dialog box")
self.dlg.ui.txtWebFooter.setText(footerFile)
-
- def apply(self):
- # create the map file
- foo = 'bar'
def toggleLayersOnly(self, isChecked):
# disable other sections if only layer export is desired
- self.dlg.ui.txtMapName.setEnabled(not isChecked)
- self.dlg.ui.txtMapWidth.setEnabled(not isChecked)
- self.dlg.ui.txtMapHeight.setEnabled(not isChecked)
- self.dlg.ui.cmbMapUnits.setEnabled(not isChecked)
- self.dlg.ui.cmbMapImageType.setEnabled(not isChecked)
- self.dlg.ui.txtMapServerUrl.setEnabled(not isChecked)
- self.dlg.ui.txtFontsetPath.setEnabled(not isChecked)
- self.dlg.ui.txtSymbolsetPath.setEnabled(not isChecked)
- self.dlg.ui.txtWebTemplate.setEnabled(not isChecked)
- self.dlg.ui.txtWebHeader.setEnabled(not isChecked)
- self.dlg.ui.txtWebFooter.setEnabled(not isChecked)
- self.dlg.ui.btnChooseFooterFile.setEnabled(not isChecked)
- self.dlg.ui.btnChooseHeaderFile.setEnabled(not isChecked)
- self.dlg.ui.btnChooseTemplateFile.setEnabled(not isChecked)
+ self.dlg.ui.grpPaths.setEnabled(not isChecked)
+ self.dlg.ui.grpMap.setEnabled(not isChecked)
Modified: trunk/qgis/python/plugins/mapserver_export/ms_export.py
===================================================================
--- trunk/qgis/python/plugins/mapserver_export/ms_export.py 2009-11-15 12:28:53 UTC (rev 12119)
+++ trunk/qgis/python/plugins/mapserver_export/ms_export.py 2009-11-15 12:42:37 UTC (rev 12120)
@@ -17,7 +17,7 @@
# presents a Qt based GUI that collects the needed information for this
# script.
# Matthew Perry contributed major portions of this work.
-# Adapted by Erik van de Pol, B3Partners BV.
+# Adapted by Erik van de Pol
#
# CHANGES SHOULD NOT BE MADE TO THE writeMapFile METHOD UNLESS YOU
# ARE CHANGING THE QgsMapserverExport CLASS AND YOU KNOW WHAT YOU ARE
@@ -25,6 +25,7 @@
from xml.dom import minidom
from string import *
+import platform
from qgis.core import QgsDataSourceURI
from qgis.core import QgsMapLayerRegistry
#from qgis.core import QgsProject
@@ -89,7 +90,10 @@
defaults.fontsPath = "./fonts/fonts.txt"
defaults.symbolsPath = "./symbols/symbols.txt"
-defaults.mapServerUrl = "http://my.host.com/cgi-bin/mapserv.exe"
+if platform.system() == "Windows":
+ defaults.mapServerUrl = "http://my.host.com/cgi-bin/mapserv.exe"
+else:
+ defaults.mapServerUrl = "http://localhost/cgi-bin/mapserv"
defaults.width = "100"
defaults.height = "100"
@@ -101,11 +105,8 @@
class Qgis2Map:
- def __init__(self, projectFile, mapFile):
- self.project = projectFile
+ def __init__(self, mapFile):
self.mapFile = mapFile
- # create the DOM
- self.qgs = minidom.parse(projectFile)
# init the other members that are not set by the constructor
self.mapServerUrl = defaults.mapServerUrl
self.fontsPath = defaults.fontsPath
@@ -126,6 +127,14 @@
self.partials = bool2str[defaults.partials]
self.symbolQueue = {}
+ def setQgsProject(self, projectFileName):
+ try:
+ self.projectFileName = projectFileName
+ # create the DOM
+ self.qgs = minidom.parse(unicode(self.projectFileName))
+ return True
+ except:
+ return False
# Set the options collected from the GUI
def setOptions(self, msUrl, units, image, mapname, width, height, template, header, footer, dump, force, antialias, partials, exportLayersOnly, fontsPath, symbolsPath):
@@ -150,15 +159,20 @@
#self.minimumScale = minscale
#self.maximumScale = maxscale
- self.template = template.encode('utf-8')
+ # TEMPLATE is needed for getFeatureInfo requests in WMS:
+ # always set someting ...
+ template = template.encode('utf-8')
+ if template == "":
+ template = "fooOnlyForWMSGetFeatureInfo"
+ self.template = template
self.header = header.encode('utf-8')
self.footer = footer.encode('utf-8')
#print units, image, mapname, width, height, template, header, footer
- self.dump = bool2str[dump]
- self.force = bool2str[force]
- self.antialias = bool2str[antialias]
- self.partials = bool2str[partials]
+ self.dump = bool2str[dump]
+ self.force = bool2str[force]
+ self.antialias = bool2str[antialias]
+ self.partials = bool2str[partials]
self.exportLayersOnly = exportLayersOnly
@@ -218,13 +232,19 @@
self.outFile.write("END")
self.outFile.close()
- logmsg += "Map file completed for " + self.project + "\n"
+ logmsg += "Map file completed for " + self.projectFileName + "\n"
logmsg += "Map file saved as " + self.mapFile + "\n"
+ if self.exportLayersOnly:
+ logmsg += "\n> We only saved the LAYER portion of the map file. Merge this into an excisting mapfile to see it working\n"
+ else:
+ logmsg += "\n> If this mapfile is accessible by your mapserver, you\nshould be able to see the capabilities by firing this url:\n" + self.mapServerUrl + "?MAP="+self.mapFile+"&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetCapabilities\n"
+ logmsg += "\n> if this mapfile is accessible by your mapserver, you\nshould be able to see a map by firing this url:\n" + self.mapServerUrl + "?MAP="+self.mapFile+"&SERVICE=WMS&LAYERS=ALL&MODE=MAP\n"
return logmsg
# Write the general parts of the map section
def writeMapSection(self):
- self.outFile.write("# Map file created from QGIS project file " + self.project.encode('utf-8') + "\n")
+ print "writeMapSection, projNaam = %s en type = %s" % (self.projectFileName, type(self.projectFileName))
+ self.outFile.write("# Map file created from QGIS project file " + str(self.projectFileName).encode('utf-8') + "\n")
self.outFile.write("# Edit this file to customize for your map interface\n")
self.outFile.write("# (Created with PyQgis MapServer Export plugin)\n")
self.outFile.write("MAP\n")
@@ -241,14 +261,14 @@
self.outFile.write(self.getExtentString())
self.outFile.write(" FONTSET '" + self.fontsPath + "'\n")
- # B3Partners uses external symbol set
+ # use of external symbol set
self.outFile.write(" SYMBOLSET '" + self.symbolsPath + "'\n")
def getExtentString(self):
stringToAddTo = ""
xmin = self.qgs.getElementsByTagName("xmin")
- stringToAddTo += " EXTENT "
+ stringToAddTo += " EXTENT "
stringToAddTo += xmin[0].childNodes[0].nodeValue.encode('utf-8')
stringToAddTo += " "
@@ -346,9 +366,9 @@
self.outFile.write(" # WMS server settings\n")
self.outFile.write(" METADATA\n")
- self.outFile.write(" 'wms_title' '" + self.mapName + "'\n")
- self.outFile.write(" 'wms_onlineresource' '" + self.mapServerUrl + "?" + "map" + "=" + self.mapFile + "'\n")
- self.outFile.write(" 'wms_srs' 'EPSG:" + epsg + "'\n")
+ self.outFile.write(" 'ows_title' '" + self.mapName + "'\n")
+ self.outFile.write(" 'ows_onlineresource' '" + self.mapServerUrl + "?" + "map" + "=" + self.mapFile + "'\n")
+ self.outFile.write(" 'ows_srs' 'EPSG:" + epsg + "'\n")
self.outFile.write(" END\n\n")
self.outFile.write(" #Scale range at which web interface will operate\n")
@@ -375,10 +395,11 @@
# get the list of legend nodes so the layers can be written in the
# proper order
resultMsg = ''
+
legend_nodes = self.qgs.getElementsByTagName("legendlayer")
self.z_order = list()
for legend_node in legend_nodes:
- self.z_order.append(legend_node.getAttribute("name").encode('utf-8').replace("\"", ""))
+ self.z_order.append(legend_node.getAttribute("name").encode('utf-8').replace("\"", "").replace(" ","_"))
# get the list of maplayer nodes
maplayers = self.qgs.getElementsByTagName("maplayer")
@@ -440,7 +461,8 @@
#layer_def += " DATA '" + uri.geometryColumn() + " FROM " + uri.quotedTablename() + "'\n"
layer_id = lyr.getElementsByTagName("id")[0].childNodes[0].nodeValue.encode("utf-8")
-
+ # TODO: check if this project is actually loaded in QGis
+ # only in loaded project files it's possible to determine the primary key of a postgis table
uniqueId = self.getPrimaryKey(layer_id, uri.table())
# %tablename% is returned when no uniqueId is found: inform user
if uniqueId.find("%") >= 0:
@@ -471,16 +493,17 @@
# Create necesssary wms metadata
format = rasterProp.getElementsByTagName('wmsFormat')[0].childNodes[0].nodeValue.encode('utf-8')
layer_def += " METADATA\n"
- layer_def += " 'wms_name' '" + ','.join(wmsNames) + "'\n"
+ layer_def += " 'ows_name' '" + ','.join(wmsNames) + "'\n"
layer_def += " 'wms_server_version' '1.1.1'\n"
try:
#ct = lyr.getElementsByTagName('coordinatetransform')[0]
#srs = ct.getElementsByTagName('sourcesrs')[0].getElementsByTagName('spatialrefsys')[0]
#epsg = srs.getElementsByTagName('epsg')[0].childNodes[0].nodeValue.encode('utf-8')
#layer_def += " 'wms_srs' 'EPSG:4326 EPSG:" + epsg + "'\n"
- layer_def += " 'wms_srs' 'EPSG:" + self.getEpsg(lyr) + "'\n"
+ layer_def += " 'ows_srs' 'EPSG:" + self.getEpsg(lyr) + "'\n"
# TODO: add epsg to all METADATA tags??
except:
+ print "ERROR while trying to write ows_srs METADATA"
pass
layer_def += " 'wms_format' '" + format + "'\n"
layer_def += " 'wms_style' '" + ','.join(wmsStyles) + "'\n"
@@ -492,7 +515,7 @@
# WMS settings for all layers
layer_def += " METADATA\n"
- layer_def += " 'wms_title' '" + lyr.getElementsByTagName("layername")[0].childNodes[0].nodeValue.encode('utf-8').replace("\"", "") + "'\n"
+ layer_def += " 'ows_title' '" + lyr.getElementsByTagName("layername")[0].childNodes[0].nodeValue.encode('utf-8').replace("\"", "") + "'\n"
layer_def += " END\n"
layer_def += " STATUS OFF\n"
@@ -511,9 +534,18 @@
layer_def += " TRANSPARENCY " + str(opacity) + "\n"
layer_def += " PROJECTION\n"
- # Get the data srs for this layer and use it to create the projection section
- datasrs = lyr.getElementsByTagName("srs")[0]
- proj4Text = datasrs.getElementsByTagName("proj4")[0].childNodes[0].nodeValue.encode('utf-8')
+
+ # Get the destination srs for this layer and use it to create the projection section
+ destsrs = self.qgs.getElementsByTagName("destinationsrs")[0]
+ proj4Text = destsrs.getElementsByTagName("proj4")[0].childNodes[0].nodeValue.encode('utf-8')
+ # TODO: you would think: take DATA-srs here, but often projected
+ # shapefiles do not contain srs data ... If we want to do this
+ # we should take make the map-srs the qgs-project srs first
+ # instead of taking the srs of the first layer
+ # Get the data srs for this layer and use it to create the projection section
+ # datasrs = lyr.getElementsByTagName("srs")[0]
+ # proj4Text = datasrs.getElementsByTagName("proj4")[0].childNodes[0].nodeValue.encode('utf-8')
+
# the proj4 text string needs to be reformatted to make mapserver happy
layer_def += self.formatProj4(proj4Text)
layer_def += " END\n"
@@ -556,7 +588,7 @@
layer_list[layer_name] = layer_def
# all layers have been processed, reverse the list and write
# not necessary since z-order is mapped by the legend list order
-# self.z_order.reverse()
+ self.z_order.reverse()
for layer in self.z_order:
self.outFile.write(layer_list[layer])
return resultMsg
@@ -573,11 +605,17 @@
we approximate the primary key by finding an integer type field containing "fid" or "id"
This is obviously a lousy solution at best.
- This script requires the project you export to be open in QGis.
+ This script requires the project you export to be open in QGis!!
"""
mlr = QgsMapLayerRegistry.instance()
layers = mlr.mapLayers()
+ if not QString(layerId) in layers:
+ # layerId of this postgis layer NOT in the layerlist... probably
+ # the project is not loaded in qgis (to be able to find the primary
+ # key, one should load the project in QGis
+ raise Exception("ERROR: layer not found in project layers.... \nThis happens with postgis layers in a project which \nis not loaded in QGis.\nDid you load this project into QGis? \nIf not please load project first, and then export it to mapserver.")
+
layer = layers[QString(layerId)]
dataProvider = layer.dataProvider()
fields = dataProvider.fields()
Modified: trunk/qgis/python/plugins/mapserver_export/qgsmapserverexportbase.ui
===================================================================
--- trunk/qgis/python/plugins/mapserver_export/qgsmapserverexportbase.ui 2009-11-15 12:28:53 UTC (rev 12119)
+++ trunk/qgis/python/plugins/mapserver_export/qgsmapserverexportbase.ui 2009-11-15 12:42:37 UTC (rev 12120)
@@ -7,375 +7,474 @@
<rect>
<x>0</x>
<y>0</y>
- <width>400</width>
- <height>522</height>
+ <width>609</width>
+ <height>507</height>
</rect>
</property>
<property name="windowTitle">
- <string>Export to Mapserver</string>
+ <string>MapServer Export: Save project to MapFile</string>
</property>
<property name="sizeGripEnabled">
<bool>true</bool>
</property>
- <layout class="QGridLayout">
- <property name="margin">
- <number>9</number>
- </property>
- <property name="spacing">
- <number>6</number>
- </property>
- <item row="5" column="0" colspan="3">
- <widget class="QGroupBox" name="grpWeb">
+ <layout class="QGridLayout" name="gridLayout">
+ <item row="0" column="0">
+ <widget class="QCheckBox" name="checkBoxCurrentProject">
+ <property name="text">
+ <string>Use current project</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <widget class="QLineEdit" name="txtQgisFilePath">
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="toolTip">
+ <string>Full path to the QGIS project file to export to MapServer map format</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="2">
+ <widget class="QPushButton" name="btnChooseProjectFile">
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>Browse...</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0" colspan="3">
+ <widget class="QGroupBox" name="groupBox">
<property name="title">
- <string>Web Interface Definition</string>
+ <string>Map file</string>
</property>
- <layout class="QGridLayout">
- <property name="margin">
- <number>0</number>
- </property>
- <property name="spacing">
- <number>0</number>
- </property>
+ <layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="0">
- <layout class="QHBoxLayout">
- <property name="spacing">
- <number>6</number>
+ <widget class="QLabel" name="textLabel7">
+ <property name="text">
+ <string>Map file</string>
</property>
- <property name="margin">
- <number>4</number>
+ <property name="buddy">
+ <cstring>txtMapFilePath</cstring>
</property>
- <item>
- <widget class="QLabel" name="textLabel5_2">
- <property name="minimumSize">
- <size>
- <width>60</width>
- <height>0</height>
- </size>
- </property>
- <property name="text">
- <string>Template</string>
- </property>
- <property name="buddy">
- <cstring>txtWebTemplate</cstring>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QLineEdit" name="txtWebTemplate">
- <property name="toolTip">
- <string>Path to the MapServer template file</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QPushButton" name="btnChooseTemplateFile">
- <property name="text">
- <string>Browse...</string>
- </property>
- </widget>
- </item>
- </layout>
+ </widget>
</item>
- <item row="1" column="0">
- <layout class="QHBoxLayout">
- <property name="spacing">
- <number>6</number>
+ <item row="0" column="1">
+ <widget class="QLineEdit" name="txtMapFilePath">
+ <property name="toolTip">
+ <string>Name for the map file to be created from the QGIS project file</string>
</property>
- <property name="margin">
- <number>4</number>
+ </widget>
+ </item>
+ <item row="0" column="2">
+ <widget class="QPushButton" name="btnChooseFile">
+ <property name="text">
+ <string>Save As...</string>
</property>
- <item>
- <widget class="QLabel" name="textLabel5">
- <property name="minimumSize">
- <size>
- <width>60</width>
- <height>0</height>
- </size>
- </property>
- <property name="text">
- <string>Header</string>
- </property>
- <property name="buddy">
- <cstring>txtWebHeader</cstring>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QLineEdit" name="txtWebHeader"/>
- </item>
- <item>
- <widget class="QPushButton" name="btnChooseHeaderFile">
- <property name="text">
- <string>Browse...</string>
- </property>
- </widget>
- </item>
- </layout>
+ </widget>
</item>
- <item row="2" column="0">
- <layout class="QHBoxLayout">
- <property name="spacing">
- <number>6</number>
+ <item row="0" column="3">
+ <widget class="QCheckBox" name="chkExpLayersOnly">
+ <property name="toolTip">
+ <string>If checked, only the layer information will be processed</string>
</property>
- <property name="margin">
- <number>4</number>
+ <property name="text">
+ <string>LAYER information only</string>
</property>
- <item>
- <widget class="QLabel" name="textLabel5_3">
- <property name="minimumSize">
- <size>
- <width>60</width>
- <height>0</height>
- </size>
- </property>
- <property name="text">
- <string>Footer</string>
- </property>
- <property name="buddy">
- <cstring>txtWebFooter</cstring>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QLineEdit" name="txtWebFooter"/>
- </item>
- <item>
- <widget class="QPushButton" name="btnChooseFooterFile">
- <property name="text">
- <string>Browse...</string>
- </property>
- </widget>
- </item>
- </layout>
+ </widget>
</item>
</layout>
</widget>
</item>
- <item row="3" column="0" colspan="3">
+ <item row="2" column="0" colspan="3">
<widget class="QGroupBox" name="grpMap">
<property name="title">
<string>Map</string>
</property>
- <layout class="QGridLayout">
- <property name="margin">
- <number>0</number>
- </property>
- <property name="spacing">
- <number>0</number>
- </property>
- <item row="2" column="0">
- <layout class="QHBoxLayout">
- <property name="spacing">
- <number>6</number>
+ <layout class="QGridLayout" name="gridLayout_2">
+ <item row="0" column="0">
+ <widget class="QLabel" name="textLabel1">
+ <property name="toolTip">
+ <string/>
</property>
- <property name="margin">
- <number>4</number>
+ <property name="text">
+ <string>Name</string>
</property>
+ <property name="buddy">
+ <cstring>txtMapName</cstring>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <widget class="QLineEdit" name="txtMapName">
+ <property name="toolTip">
+ <string>Prefix attached to map, scalebar and legend GIF filenames created using this MapFile</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="2">
+ <widget class="QLabel" name="textLabel4">
+ <property name="text">
+ <string>Image type</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+ </property>
+ <property name="buddy">
+ <cstring>cmbMapImageType</cstring>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="3">
+ <widget class="QComboBox" name="cmbMapImageType">
<item>
- <widget class="QLabel" name="textLabel3">
- <property name="text">
- <string>Units</string>
- </property>
- <property name="alignment">
- <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
- </property>
- <property name="buddy">
- <cstring>cmbMapUnits</cstring>
- </property>
- </widget>
+ <property name="text">
+ <string>png</string>
+ </property>
</item>
<item>
- <widget class="QComboBox" name="cmbMapUnits"/>
+ <property name="text">
+ <string>gif</string>
+ </property>
</item>
<item>
- <widget class="QLabel" name="textLabel4">
- <property name="text">
- <string>Image type</string>
- </property>
- <property name="alignment">
- <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
- </property>
- <property name="buddy">
- <cstring>cmbMapImageType</cstring>
- </property>
- </widget>
+ <property name="text">
+ <string>gtiff</string>
+ </property>
</item>
<item>
- <widget class="QComboBox" name="cmbMapImageType">
- <item>
- <property name="text">
- <string>png</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>gif</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>gtiff</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>jpeg</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>swf</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>userdefined</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>wbmp</string>
- </property>
- </item>
- </widget>
+ <property name="text">
+ <string>jpeg</string>
+ </property>
</item>
- </layout>
- </item>
- <item row="1" column="0">
- <layout class="QHBoxLayout">
- <property name="spacing">
- <number>6</number>
- </property>
- <property name="margin">
- <number>4</number>
- </property>
<item>
- <widget class="QLabel" name="textLabel2">
- <property name="text">
- <string>Width</string>
- </property>
- <property name="buddy">
- <cstring>txtMapWidth</cstring>
- </property>
- </widget>
+ <property name="text">
+ <string>swf</string>
+ </property>
</item>
<item>
- <widget class="QLineEdit" name="txtMapWidth"/>
+ <property name="text">
+ <string>userdefined</string>
+ </property>
</item>
<item>
- <widget class="QLabel" name="textLabel2_2">
- <property name="text">
- <string>Height</string>
- </property>
- <property name="buddy">
- <cstring>txtMapHeight</cstring>
- </property>
- </widget>
+ <property name="text">
+ <string>wbmp</string>
+ </property>
</item>
- <item>
- <widget class="QLineEdit" name="txtMapHeight"/>
- </item>
- </layout>
+ </widget>
</item>
- <item row="0" column="0">
- <layout class="QHBoxLayout">
- <property name="spacing">
- <number>6</number>
+ <item row="0" column="4">
+ <widget class="QLabel" name="label">
+ <property name="enabled">
+ <bool>false</bool>
</property>
- <property name="margin">
- <number>4</number>
+ <property name="text">
+ <string>Rendering</string>
</property>
- <item>
- <widget class="QLabel" name="textLabel1">
- <property name="toolTip">
- <string/>
- </property>
- <property name="text">
- <string>Name</string>
- </property>
- <property name="buddy">
- <cstring>txtMapName</cstring>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QLineEdit" name="txtMapName">
- <property name="toolTip">
- <string>Prefix attached to map, scalebar and legend GIF filenames created using this MapFile</string>
- </property>
- </widget>
- </item>
- </layout>
+ </widget>
</item>
+ <item row="0" column="5">
+ <widget class="QComboBox" name="comboBox">
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0">
+ <widget class="QLabel" name="textLabel2">
+ <property name="text">
+ <string>Width</string>
+ </property>
+ <property name="buddy">
+ <cstring>txtMapWidth</cstring>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1">
+ <widget class="QLineEdit" name="txtMapWidth"/>
+ </item>
+ <item row="1" column="2">
+ <widget class="QLabel" name="textLabel2_2">
+ <property name="text">
+ <string>Height</string>
+ </property>
+ <property name="buddy">
+ <cstring>txtMapHeight</cstring>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="3">
+ <widget class="QLineEdit" name="txtMapHeight"/>
+ </item>
+ <item row="1" column="4">
+ <widget class="QLabel" name="textLabel3">
+ <property name="text">
+ <string>Units</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+ </property>
+ <property name="buddy">
+ <cstring>cmbMapUnits</cstring>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="5">
+ <widget class="QComboBox" name="cmbMapUnits"/>
+ </item>
+ <item row="2" column="0">
+ <widget class="QLabel" name="textLabelMapServerUrl">
+ <property name="minimumSize">
+ <size>
+ <width>80</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>MapServer url</string>
+ </property>
+ <property name="buddy">
+ <cstring>txtMapServerUrl</cstring>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1" colspan="5">
+ <widget class="QLineEdit" name="txtMapServerUrl">
+ <property name="toolTip">
+ <string>The URL to the mapserver executable.
+
+For example:
+http://my.host.com/cgi-bin/mapserv.exe</string>
+ </property>
+ <property name="text">
+ <string/>
+ </property>
+ </widget>
+ </item>
</layout>
</widget>
</item>
- <item row="0" column="0">
- <widget class="QLabel" name="textLabel7">
- <property name="text">
- <string>Map file</string>
+ <item row="3" column="0" colspan="3">
+ <widget class="QGroupBox" name="grpPaths">
+ <property name="title">
+ <string>Paths</string>
</property>
- <property name="buddy">
- <cstring>txtMapFilePath</cstring>
- </property>
+ <layout class="QGridLayout" name="gridLayout_4">
+ <item row="0" column="0">
+ <widget class="QCheckBox" name="checkBoxInlineFontAndSymbol">
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>Inline</string>
+ </property>
+ <property name="checked">
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <widget class="QLabel" name="textLabelSymbolsetPath">
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>80</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>Symbolset</string>
+ </property>
+ <property name="buddy">
+ <cstring>txtSymbolsetPath</cstring>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0">
+ <widget class="QCheckBox" name="checkBoxUseTemplates">
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>Use templates</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="2" colspan="3">
+ <widget class="QLineEdit" name="txtWebTemplate">
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="toolTip">
+ <string>Path to the MapServer template file</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="5">
+ <widget class="QPushButton" name="btnChooseTemplateFile">
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="text">
+ <string>Browse...</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="2" colspan="3">
+ <widget class="QLineEdit" name="txtWebHeader">
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="5">
+ <widget class="QPushButton" name="btnChooseHeaderFile">
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="text">
+ <string>Browse...</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="2" colspan="3">
+ <widget class="QLineEdit" name="txtWebFooter">
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="5">
+ <widget class="QPushButton" name="btnChooseFooterFile">
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="text">
+ <string>Browse...</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="5">
+ <widget class="QLineEdit" name="txtFontsetPath">
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="toolTip">
+ <string>The file name of the fonts file.</string>
+ </property>
+ <property name="text">
+ <string/>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="4">
+ <widget class="QLabel" name="textLabelFontsetPath">
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>80</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>Fontset</string>
+ </property>
+ <property name="buddy">
+ <cstring>txtFontsetPath</cstring>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="2">
+ <widget class="QLineEdit" name="txtSymbolsetPath">
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="toolTip">
+ <string>The file name of the symbols file.</string>
+ </property>
+ <property name="text">
+ <string/>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1">
+ <widget class="QLabel" name="textLabel5_2">
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>60</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>Template</string>
+ </property>
+ <property name="buddy">
+ <cstring>txtWebTemplate</cstring>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1">
+ <widget class="QLabel" name="textLabel5">
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>60</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>Header</string>
+ </property>
+ <property name="buddy">
+ <cstring>txtWebHeader</cstring>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="1">
+ <widget class="QLabel" name="textLabel5_3">
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>60</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>Footer</string>
+ </property>
+ <property name="buddy">
+ <cstring>txtWebFooter</cstring>
+ </property>
+ </widget>
+ </item>
+ </layout>
</widget>
</item>
- <item row="0" column="1">
- <widget class="QLineEdit" name="txtMapFilePath">
- <property name="toolTip">
- <string>Name for the map file to be created from the QGIS project file</string>
- </property>
- </widget>
- </item>
- <item row="1" column="2">
- <widget class="QPushButton" name="btnChooseProjectFile">
- <property name="text">
- <string>Browse...</string>
- </property>
- </widget>
- </item>
- <item row="1" column="1">
- <widget class="QLineEdit" name="txtQgisFilePath">
- <property name="toolTip">
- <string>Full path to the QGIS project file to export to MapServer map format</string>
- </property>
- </widget>
- </item>
- <item row="1" column="0">
- <widget class="QLabel" name="textLabel7_2">
- <property name="text">
- <string>QGIS project file</string>
- </property>
- <property name="buddy">
- <cstring>txtQgisFilePath</cstring>
- </property>
- </widget>
- </item>
- <item row="0" column="2">
- <widget class="QPushButton" name="btnChooseFile">
- <property name="text">
- <string>Save As...</string>
- </property>
- </widget>
- </item>
- <item row="2" column="1" colspan="2">
- <widget class="QCheckBox" name="chkExpLayersOnly">
- <property name="toolTip">
- <string>If checked, only the layer information will be processed</string>
- </property>
- <property name="text">
- <string>Export LAYER information only</string>
- </property>
- </widget>
- </item>
- <item row="7" column="0" colspan="3">
+ <item row="6" column="0" colspan="3">
<widget class="QDialogButtonBox" name="buttonBox">
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Help|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
- <item row="6" column="0" colspan="3">
+ <item row="4" column="0" colspan="3">
<widget class="QGroupBox" name="grpOptions">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
@@ -384,211 +483,60 @@
</sizepolicy>
</property>
<property name="title">
- <string>Options</string>
+ <string>Layer/label options</string>
</property>
- <layout class="QGridLayout" name="gridLayout" rowstretch="0" rowminimumheight="0">
- <property name="margin">
- <number>0</number>
- </property>
- <property name="spacing">
- <number>0</number>
- </property>
+ <layout class="QGridLayout" name="gridLayout_5">
<item row="0" column="0">
- <layout class="QHBoxLayout" name="optionsLayout" stretch="0,0,0,0">
- <property name="sizeConstraint">
- <enum>QLayout::SetDefaultConstraint</enum>
+ <widget class="QCheckBox" name="checkBoxForce">
+ <property name="toolTip">
+ <string>Forces labels on, regardless of collisions. Available only for cached labels.</string>
</property>
- <property name="margin">
- <number>4</number>
+ <property name="text">
+ <string>Force</string>
</property>
- <item>
- <widget class="QCheckBox" name="checkBoxForce">
- <property name="toolTip">
- <string>Forces labels on, regardless of collisions. Available only for cached labels.</string>
- </property>
- <property name="text">
- <string>Force</string>
- </property>
- <property name="checked">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QCheckBox" name="checkBoxAntiAlias">
- <property name="toolTip">
- <string>Should text be antialiased? Note that this requires more available colors, decreases drawing performance, and results in slightly larger output images.</string>
- </property>
- <property name="text">
- <string>Anti-alias</string>
- </property>
- <property name="checked">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QCheckBox" name="checkBoxPartials">
- <property name="toolTip">
- <string>Can text run off the edge of the map?</string>
- </property>
- <property name="text">
- <string>Partials</string>
- </property>
- <property name="checked">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QCheckBox" name="checkBoxDump">
- <property name="toolTip">
- <string>Check to allow MapServer to return data in GML format. Useful when used with WMS GetFeatureInfo operations.</string>
- </property>
- <property name="text">
- <string>Dump</string>
- </property>
- <property name="checked">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- </layout>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
</item>
- </layout>
- </widget>
- </item>
- <item row="4" column="0" colspan="3">
- <widget class="QGroupBox" name="grpPaths">
- <property name="title">
- <string>Paths</string>
- </property>
- <layout class="QGridLayout" name="gridLayout_2">
- <property name="margin">
- <number>0</number>
- </property>
- <property name="spacing">
- <number>0</number>
- </property>
- <item row="0" column="0">
- <layout class="QHBoxLayout" name="horizontalLayout">
- <property name="margin">
- <number>4</number>
+ <item row="0" column="1">
+ <widget class="QCheckBox" name="checkBoxAntiAlias">
+ <property name="toolTip">
+ <string>Should text be antialiased? Note that this requires more available colors, decreases drawing performance, and results in slightly larger output images.</string>
</property>
- <item>
- <widget class="QLabel" name="textLabelMapServerUrl">
- <property name="minimumSize">
- <size>
- <width>80</width>
- <height>0</height>
- </size>
- </property>
- <property name="text">
- <string>MapServer url</string>
- </property>
- <property name="buddy">
- <cstring>txtMapServerUrl</cstring>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QLineEdit" name="txtMapServerUrl">
- <property name="toolTip">
- <string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
-<html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">The URL to the mapserver executable.</span></p>
-<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;"></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">For example: </span></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">http://my.host.com/cgi-bin/mapserv.exe</span></p></body></html></string>
- </property>
- <property name="text">
- <string/>
- </property>
- </widget>
- </item>
- </layout>
+ <property name="text">
+ <string>Anti-alias</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
</item>
- <item row="1" column="0">
- <layout class="QHBoxLayout" name="horizontalLayout_2">
- <property name="margin">
- <number>4</number>
+ <item row="0" column="2">
+ <widget class="QCheckBox" name="checkBoxPartials">
+ <property name="toolTip">
+ <string>Can text run off the edge of the map?</string>
</property>
- <item>
- <widget class="QLabel" name="textLabelFontsetPath">
- <property name="minimumSize">
- <size>
- <width>80</width>
- <height>0</height>
- </size>
- </property>
- <property name="text">
- <string>Fontset path</string>
- </property>
- <property name="buddy">
- <cstring>txtFontsetPath</cstring>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QLineEdit" name="txtFontsetPath">
- <property name="toolTip">
- <string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
-<html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">The URL to the mapserver executable.</span></p>
-<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;"></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">For example: </span></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">http://my.host.com/cgi-bin/mapserv.exe</span></p></body></html></string>
- </property>
- <property name="text">
- <string/>
- </property>
- </widget>
- </item>
- </layout>
+ <property name="text">
+ <string>Partials</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
</item>
- <item row="2" column="0">
- <layout class="QHBoxLayout" name="horizontalLayout_3">
- <property name="margin">
- <number>4</number>
+ <item row="0" column="3">
+ <widget class="QCheckBox" name="checkBoxDump">
+ <property name="toolTip">
+ <string>Check to allow MapServer to return data in GML format. Useful when used with WMS GetFeatureInfo operations.</string>
</property>
- <item>
- <widget class="QLabel" name="textLabelSymbolsetPath">
- <property name="minimumSize">
- <size>
- <width>80</width>
- <height>0</height>
- </size>
- </property>
- <property name="text">
- <string>Symbolset path</string>
- </property>
- <property name="buddy">
- <cstring>txtSymbolsetPath</cstring>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QLineEdit" name="txtSymbolsetPath">
- <property name="toolTip">
- <string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
-<html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">The URL to the mapserver executable.</span></p>
-<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;"></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">For example: </span></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">http://my.host.com/cgi-bin/mapserv.exe</span></p></body></html></string>
- </property>
- <property name="text">
- <string/>
- </property>
- </widget>
- </item>
- </layout>
+ <property name="text">
+ <string>Dump</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
</item>
</layout>
</widget>
@@ -598,43 +546,14 @@
<layoutdefault spacing="6" margin="11"/>
<pixmapfunction>qPixmapFromMimeSource</pixmapfunction>
<tabstops>
- <tabstop>txtMapFilePath</tabstop>
- <tabstop>btnChooseFile</tabstop>
- <tabstop>txtQgisFilePath</tabstop>
- <tabstop>btnChooseProjectFile</tabstop>
- <tabstop>chkExpLayersOnly</tabstop>
<tabstop>txtMapName</tabstop>
<tabstop>txtMapWidth</tabstop>
<tabstop>txtMapHeight</tabstop>
- <tabstop>cmbMapUnits</tabstop>
- <tabstop>cmbMapImageType</tabstop>
- <tabstop>txtWebTemplate</tabstop>
- <tabstop>btnChooseTemplateFile</tabstop>
- <tabstop>txtWebHeader</tabstop>
- <tabstop>btnChooseHeaderFile</tabstop>
- <tabstop>txtWebFooter</tabstop>
- <tabstop>btnChooseFooterFile</tabstop>
</tabstops>
<resources/>
<connections>
<connection>
<sender>buttonBox</sender>
- <signal>accepted()</signal>
- <receiver>QgsMapserverExportBase</receiver>
- <slot>accept()</slot>
- <hints>
- <hint type="sourcelabel">
- <x>335</x>
- <y>422</y>
- </hint>
- <hint type="destinationlabel">
- <x>240</x>
- <y>223</y>
- </hint>
- </hints>
- </connection>
- <connection>
- <sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>QgsMapserverExportBase</receiver>
<slot>reject()</slot>
More information about the QGIS-commit
mailing list