Skip to content

Commit

Permalink
[BUGFIX] Set default units to mm in GetStyles
Browse files Browse the repository at this point in the history
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 4408dfe commit b0f6e30
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/server/qgswmsprojectparser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1538,6 +1538,7 @@ QDomDocument QgsWMSProjectParser::getStyles( QStringList& layerList ) const
// Create the root element
QDomElement root = myDocument.createElementNS( "http://www.opengis.net/sld", "StyledLayerDescriptor" );
root.setAttribute( "version", "1.1.0" );
root.setAttribute( "units", "mm" ); // default qgsmaprenderer is Millimeters
root.setAttribute( "xsi:schemaLocation", "http://www.opengis.net/sld http://schemas.opengis.net/sld/1.1.0/StyledLayerDescriptor.xsd" );
root.setAttribute( "xmlns:ogc", "http://www.opengis.net/ogc" );
root.setAttribute( "xmlns:se", "http://www.opengis.net/se" );
Expand Down

0 comments on commit b0f6e30

Please sign in to comment.