Skip to content
Permalink
Browse files

Merge pull request #39684 from elpaso/bugfix-gh39682-server-getfeatur…

…einfo-json-composite-pks

Fix wms getfeatureinfo json with composite pks
  • Loading branch information
elpaso committed Oct 29, 2020
2 parents bda2e10 + 3f88d74 commit 8a8fd55611f316a5b2cb251c66324f548f86f098
Showing with 13 additions and 2 deletions.
  1. +13 −2 src/server/services/wms/qgswmsrenderer.cpp
@@ -2246,8 +2246,19 @@ namespace QgsWms
for ( int j = 0; j < featuresNode.size(); ++j )
{
const QDomElement featureNode = featuresNode.at( j ).toElement();
const QgsFeatureId fid = featureNode.attribute( QStringLiteral( "id" ) ).toLongLong();
QgsFeature feature = QgsFeature( vl->getFeature( fid ) );
const QString fid = featureNode.attribute( QStringLiteral( "id" ) );
QgsFeature feature;
const QString expression { QgsServerFeatureId::getExpressionFromServerFid( fid, static_cast<QgsVectorDataProvider *>( layer->dataProvider() ) ) };
if ( expression.isEmpty() )
{
feature = vl->getFeature( fid.toLongLong() );
}
else
{
QgsFeatureRequest request { QgsExpression( expression )};
request.setFlags( QgsFeatureRequest::Flag::NoGeometry );
vl->getFeatures( request ).nextFeature( feature );
}

QString wkt;
if ( withGeometry )

0 comments on commit 8a8fd55

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