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 b6a4194 commit eb5717d53916eb3f5886ddcee2a4111a3ac2dc9f
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 eb5717d

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