Navigation Menu

Skip to content

Commit

Permalink
Try to detect WFS feature type if not available in describeFeatureTyp…
Browse files Browse the repository at this point in the history
…e response. Fixes ticket #5745
  • Loading branch information
mhugent committed Jun 8, 2012
1 parent 2d722b1 commit 7b08cba
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/providers/wfs/qgswfsprovider.cpp
Expand Up @@ -95,6 +95,18 @@ QgsWFSProvider::QgsWFSProvider( const QString& uri )
return;
}

//Failed to detect feature type from describeFeatureType -> get first feature from layer to detect type
if ( mWKBType == QGis::WKBUnknown )
{
QString bkUri = dataSourceUri();
QUrl typeDetectionUri( uri );
typeDetectionUri.removeQueryItem( "BBOX" );
typeDetectionUri.addQueryItem( "MAXFEATURES", "1" );
setDataSourceUri( typeDetectionUri.toString() );
reloadData();
setDataSourceUri( bkUri );
}

if ( ! uri.contains( "BBOX" ) )
{ //"Cache Features" option; get all features in layer immediately
reloadData();
Expand Down

0 comments on commit 7b08cba

Please sign in to comment.