Skip to content
Permalink
Browse files

[BUGFIX][QGIS Server] Apply filter element

  • Loading branch information
rldhont committed Nov 2, 2016
1 parent 189d8f5 commit e64d647532edf3565459f1f8555b0f47d403f9be
Showing with 16 additions and 0 deletions.
  1. +16 −0 src/server/qgswfsserver.cpp
@@ -656,6 +656,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 e64d647

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