Skip to content
Browse files
[BUGFIX] Set default units to mm in GetStyles
The default units in QgsMapRenderer is Millimeters. The default units in SLD
 is Pixel but exportSld does not convert all millimeters in pixels.

We notes this bug by comparing default QGS Server rendering and rendering with
 the SLD generated by QGIS.

To resolve it, we just have to add units to the document element.
  • Loading branch information
rldhont committed Oct 23, 2015
1 parent 2e85053 commit f7ce8b94344e7a7dd12fac2a90bd84df30b7e82f
Showing with 1 addition and 0 deletions.
  1. +1 −0 src/server/qgswmsprojectparser.cpp
@@ -1538,6 +1538,7 @@ QDomDocument QgsWMSProjectParser::getStyles( QStringList& layerList ) const
// Create the root element
QDomElement root = myDocument.createElementNS( "", "StyledLayerDescriptor" );
root.setAttribute( "version", "1.1.0" );
root.setAttribute( "units", "mm" ); // default qgsmaprenderer is Millimeters
root.setAttribute( "xsi:schemaLocation", "" );
root.setAttribute( "xmlns:ogc", "" );
root.setAttribute( "xmlns:se", "" );

0 comments on commit f7ce8b9

Please sign in to comment.