Skip to content
Permalink
Browse files

[BUGFIX][QGIS Server] Apply filter element

  • Loading branch information
rldhont committed Nov 2, 2016
1 parent ef012c4 commit f692e191d4ee6692fd219f34ab762ec2879b3cba
Showing with 16 additions and 0 deletions.
  1. +16 −0 src/server/qgswfsserver.cpp
@@ -657,6 +657,22 @@ int QgsWFSServer::getFeature( QgsRequestHandler& request, const QString& format
{
throw QgsMapServiceException( "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 f692e19

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