Skip to content
Permalink
Browse files

[BUGFIX][QGIS Server] Apply filter element

  • Loading branch information
rldhont committed Nov 2, 2016
1 parent 2be0f01 commit 963d75f471124a39131ba8a1f5f155035f9d6046
Showing with 16 additions and 0 deletions.
  1. +16 −0 src/server/qgswfsserver.cpp
@@ -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 );

0 comments on commit 963d75f

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