Skip to content

Commit

Permalink
[Backport release-3_16] Fix atlas filtering when exporting using proc…
Browse files Browse the repository at this point in the history
…essing algorithms (#44519)

* filter features when exporting atlas image and filter is enabled

* filter features when exporting atlas pdf and filter is enabled

* fixed tests

* removed functions for filtering and unfiltering the atlas coverage layer

Co-authored-by: Samweli <samweli@kartoza.com>
  • Loading branch information
qgis-bot and Samweli committed Aug 2, 2021
1 parent 32270fc commit 907d976
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/analysis/processing/qgsalgorithmlayoutatlastoimage.cpp
Expand Up @@ -141,6 +141,7 @@ QVariantMap QgsLayoutAtlasToImageAlgorithm::processAlgorithm( const QVariantMap

expression = parameterAsString( parameters, QStringLiteral( "FILTER_EXPRESSION" ), context );
atlas->setFilterExpression( expression, error );
atlas->setFilterFeatures( !expression.isEmpty() && error.isEmpty() );
if ( !expression.isEmpty() && !error.isEmpty() )
{
throw QgsProcessingException( QObject::tr( "Error setting atlas filter expression" ) );
Expand Down
1 change: 1 addition & 0 deletions src/analysis/processing/qgsalgorithmlayoutatlastopdf.cpp
Expand Up @@ -143,6 +143,7 @@ QVariantMap QgsLayoutAtlasToPdfAlgorithm::processAlgorithm( const QVariantMap &p

expression = parameterAsString( parameters, QStringLiteral( "FILTER_EXPRESSION" ), context );
atlas->setFilterExpression( expression, error );
atlas->setFilterFeatures( !expression.isEmpty() && error.isEmpty() );
if ( !expression.isEmpty() && !error.isEmpty() )
{
throw QgsProcessingException( QObject::tr( "Error setting atlas filter expression" ) );
Expand Down

0 comments on commit 907d976

Please sign in to comment.