Skip to content

Commit f7ce8b9

Browse files
committedOct 23, 2015
[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.
1 parent 2e85053 commit f7ce8b9

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed
 

‎src/server/qgswmsprojectparser.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1538,6 +1538,7 @@ QDomDocument QgsWMSProjectParser::getStyles( QStringList& layerList ) const
15381538
// Create the root element
15391539
QDomElement root = myDocument.createElementNS( "http://www.opengis.net/sld", "StyledLayerDescriptor" );
15401540
root.setAttribute( "version", "1.1.0" );
1541+
root.setAttribute( "units", "mm" ); // default qgsmaprenderer is Millimeters
15411542
root.setAttribute( "xsi:schemaLocation", "http://www.opengis.net/sld http://schemas.opengis.net/sld/1.1.0/StyledLayerDescriptor.xsd" );
15421543
root.setAttribute( "xmlns:ogc", "http://www.opengis.net/ogc" );
15431544
root.setAttribute( "xmlns:se", "http://www.opengis.net/se" );

0 commit comments

Comments
 (0)
Please sign in to comment.