Skip to content
Permalink
Browse files
Fix for line pattern sld export
  • Loading branch information
mhugent committed Jun 23, 2014
1 parent be27000 commit 3e98d7d8a11a3025778b1e4782d18ab79db5aaad
Showing with 24 additions and 7 deletions.
  1. +4 −6 src/core/symbology-ng/qgsfillsymbollayerv2.cpp
  2. +20 −1 src/core/symbology-ng/qgssymbollayerv2utils.cpp
@@ -2636,7 +2636,10 @@ void QgsLinePatternFillSymbolLayer::toSld( QDomDocument &doc, QDomElement &eleme
QDomElement graphicElem = doc.createElement( "se:Graphic" );
graphicFillElem.appendChild( graphicElem );

QgsSymbolLayerV2Utils::wellKnownMarkerToSld( doc, graphicElem, "horline", QColor(), mColor, Qt::SolidLine, mLineWidth, mDistance );
//line properties must be inside the graphic definition
QColor lineColor = mFillLineSymbol ? mFillLineSymbol->color() : QColor();
double lineWidth = mFillLineSymbol ? mFillLineSymbol->width() : 0.0;
QgsSymbolLayerV2Utils::wellKnownMarkerToSld( doc, graphicElem, "horline", QColor(), lineColor, Qt::SolidLine, lineWidth, mDistance );

// <Rotation>
QString angleFunc;
@@ -2655,11 +2658,6 @@ void QgsLinePatternFillSymbolLayer::toSld( QDomDocument &doc, QDomElement &eleme
// <se:Displacement>
QPointF lineOffset( sin( mLineAngle ) * mOffset, cos( mLineAngle ) * mOffset );
QgsSymbolLayerV2Utils::createDisplacementElement( doc, graphicElem, lineOffset );

if ( mFillLineSymbol )
{
mFillLineSymbol->toSld( doc, element, props );
}
}

QString QgsLinePatternFillSymbolLayer::ogrFeatureStyleWidth( double widthScaleFactor ) const
@@ -2417,8 +2417,27 @@ bool QgsSymbolLayerV2Utils::createFunctionElement( QDomDocument &doc, QDomElemen
bool QgsSymbolLayerV2Utils::functionFromSldElement( QDomElement &element, QString &function )
{
QgsDebugMsg( "Entered." );
QDomElement elem;
if ( element.tagName() == "Filter" )
{
elem = element;
}
else
{
QDomNodeList filterNodes = element.elementsByTagName( "Filter" );
if ( filterNodes.size() > 0 )
{
elem = filterNodes.at( 0 ).toElement();
}
}

if ( elem.isNull() )
{
return false;
}


QgsExpression *expr = QgsOgcUtils::expressionFromOgcFilter( element );
QgsExpression *expr = QgsOgcUtils::expressionFromOgcFilter( elem );
if ( !expr )
return false;

0 comments on commit 3e98d7d

Please sign in to comment.