Skip to content
Permalink
Browse files

[BUGFIX] In WFS GetFeature joined fields not are not returned

In the WFS GetFeature Request, the joined fields are not returned. It's due to
 the use of provider instead of layer to retrieve all fields.

The correction is to use layer->pendingFields() and layer->pendingAllAttributesList()
  • Loading branch information
rldhont committed Mar 30, 2015
1 parent c7b28db commit 4f36b6572e71ed16f2071081f2f152c1d290b7cb
Showing with 8 additions and 4 deletions.
  1. +8 −4 src/server/qgswfsserver.cpp
@@ -463,10 +463,12 @@ int QgsWFSServer::getFeature( QgsRequestHandler& request, const QString& format

QgsFeature feature;
QgsAttributeMap featureAttributes;
const QgsFields& fields = provider->fields();
//const QgsFields& fields = provider->fields();
const QgsFields& fields = layer->pendingFields();

mWithGeom = true;
QgsAttributeList attrIndexes = provider->attributeIndexes();
//QgsAttributeList attrIndexes = provider->attributeIndexes();
QgsAttributeList attrIndexes = layer->pendingAllAttributesList();

QDomNodeList queryChildNodes = queryElem.childNodes();
if ( queryChildNodes.size() )
@@ -804,12 +806,14 @@ int QgsWFSServer::getFeature( QgsRequestHandler& request, const QString& format

QgsFeature feature;
QgsAttributeMap featureAttributes;
const QgsFields& fields = provider->fields();
//const QgsFields& fields = provider->fields();
const QgsFields& fields = layer->pendingFields();

//map extent
searchRect = layer->extent();

QgsAttributeList attrIndexes = provider->attributeIndexes();
//QgsAttributeList attrIndexes = provider->attributeIndexes();
QgsAttributeList attrIndexes = layer->pendingAllAttributesList();
if ( mPropertyName != "*" )
{
QStringList attrList = mPropertyName.split( "," );

0 comments on commit 4f36b65

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