Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[BUGFIX][QGIS Server] Apply filter element
  • Loading branch information
rldhont committed Nov 2, 2016
1 parent 2be0f01 commit 963d75f
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/server/qgswfsserver.cpp
Expand Up @@ -655,6 +655,22 @@ int QgsWfsServer::getFeature( QgsRequestHandler& request, const QString& format
{
throw QgsMapServiceException( QStringLiteral( "RequestNotWellFormed" ), filter->parserErrorString() );
}
QgsFeatureRequest req;
req.setFlags( QgsFeatureRequest::ExactIntersect | ( mWithGeom ? QgsFeatureRequest::NoFlags : QgsFeatureRequest::NoGeometry ) );
req.setFilterExpression( filter->expression() );
#ifdef HAVE_SERVER_PYTHON_PLUGINS
mAccessControl->filterFeatures( layer, req );

QStringList attributes = QStringList();
Q_FOREACH ( int idx, attrIndexes )
{
attributes.append( layer->pendingFields().field( idx ).name() );
}
req.setSubsetOfAttributes(
mAccessControl->layerAttributes( layer, attributes ),
layer->pendingFields() );
#endif
QgsFeatureIterator fit = layer->getFeatures( req );
while ( fit.nextFeature( feature ) && ( !hasFeatureLimit || featureCounter < maxFeatures + startIndex ) )
{
expressionContext.setFeature( feature );
Expand Down

0 comments on commit 963d75f

Please sign in to comment.