Skip to content
Permalink
Browse files

BUG #9674 WFS GetFeature Request does not return features

The GetFeature Request does not return elements.

The response of the request is valid but with a bbox : 0,0,0,0 and no features.
The simple request :
* SERVICE=WFS
* VERSION=1.0.0
* REQUEST=GeTFeature
* TYPENAME=*
* OUTPUTFORMAT=*
return no features.
  • Loading branch information
rldhont committed Feb 28, 2014
1 parent 87e6b13 commit ccde1d48d8efc867724a2d680e524c6443321fe9
Showing with 23 additions and 12 deletions.
  1. +19 −9 src/mapserver/qgsprojectparser.cpp
  2. +4 −3 src/mapserver/qgswfsserver.cpp
@@ -836,34 +836,44 @@ void QgsProjectParser::describeCoverage( const QString& aCoveName, QDomElement&
}
}

QList<QgsMapLayer*> QgsProjectParser::mapLayerFromTypeName( const QString& tName, bool useCache ) const
QList<QgsMapLayer*> QgsProjectParser::mapLayerFromTypeName( const QString& aTypeName, bool useCache ) const
{
QList<QgsMapLayer*> layerList;

if ( mProjectLayerElements.size() < 1 )
{
return layerList;
}

QStringList wfsLayersId = wfsLayers();

QStringList typeNameList;
if ( aTypeName != "" )
{
QStringList typeNameSplit = aTypeName.split( "," );
foreach ( const QString &str, typeNameSplit )
{
if ( str.contains( ":" ) )
typeNameList << str.section( ":", 1, 1 );
else
typeNameList << str;
}
}

foreach ( const QDomElement &elem, mProjectLayerElements )
{
QString type = elem.attribute( "type" );
if ( type == "vector" )
{
QgsMapLayer *mLayer = createLayerFromElement( elem, useCache );
QgsMapLayer *mLayer = createLayerFromElement( elem );
QgsVectorLayer* layer = dynamic_cast<QgsVectorLayer*>( mLayer );
if ( !layer || !wfsLayersId.contains( layer->id() ) )
return layerList;
if ( !layer )
continue;

QString typeName = layer->name();
typeName = typeName.replace( " ", "_" );
if ( tName == typeName )
{

if ( wfsLayersId.contains( layer->id() ) && ( aTypeName == "" || typeNameList.contains( typeName ) ) )
layerList.push_back( mLayer );
return layerList;
}
}
}
return layerList;
@@ -1015,11 +1015,12 @@ int QgsWFSServer::getFeature( QgsRequestHandler& request, const QString& format
}

}
if ( featureCounter == 0 )
startGetFeature( request, format, layerCrs, &searchRect );

QgsMapLayerRegistry::instance()->removeAllMapLayers();
endGetFeature( request, format );
if ( featureCounter == 0 )
throw QgsMapServiceException( "RequestNotWellFormed", mErrors.join( ". " ) );
else
endGetFeature( request, format );

return 0;
}

0 comments on commit ccde1d4

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