Skip to content
Permalink
Browse files

Add geometry generator required fields to request

  • Loading branch information
m-kuhn committed Mar 11, 2019
1 parent 6eec3a7 commit 6b42ccb737c1ec7fa43838abaeba336b6d86c6ef
Showing with 10 additions and 1 deletion.
  1. +10 −1 src/core/qgspallabeling.cpp
@@ -486,7 +486,16 @@ bool QgsPalLayerSettings::prepare( const QgsRenderContext &context, QSet<QString
mGeometryGeneratorExpression = QgsExpression( geometryGenerator );
mGeometryGeneratorExpression.prepare( &context.expressionContext() );
if ( mGeometryGeneratorExpression.hasParserError() )
{
QgsMessageLog::logMessage( QObject::tr( "Labeling" ), mGeometryGeneratorExpression.parserErrorString() );
return false;
}

const auto referencedColumns = mGeometryGeneratorExpression.referencedColumns();
for ( const QString &name : referencedColumns )
{
attributeNames.insert( name );
}
}

return true;
@@ -1601,7 +1610,7 @@ void QgsPalLayerSettings::registerFeature( const QgsFeature &f, QgsRenderContext
std::unique_ptr<QgsGeometry> scopedClonedGeom;
if ( simplifyMethod.simplifyHints() != QgsVectorSimplifyMethod::NoSimplification && simplifyMethod.forceLocalOptimization() )
{
int simplifyHints = simplifyMethod.simplifyHints() | QgsMapToPixelSimplifier::SimplifyEnvelope;
unsigned int simplifyHints = simplifyMethod.simplifyHints() | QgsMapToPixelSimplifier::SimplifyEnvelope;
QgsMapToPixelSimplifier::SimplifyAlgorithm simplifyAlgorithm = static_cast< QgsMapToPixelSimplifier::SimplifyAlgorithm >( simplifyMethod.simplifyAlgorithm() );
QgsGeometry g = geom;
QgsMapToPixelSimplifier simplifier( simplifyHints, simplifyMethod.tolerance(), simplifyAlgorithm );

0 comments on commit 6b42ccb

Please sign in to comment.
You can’t perform that action at this time.