wms identify: report error if features types were guessed from GML but no features parsed

This commit is contained in:
Radim Blazek 2014-02-13 10:59:46 +01:00
parent 8f829750a2
commit ee236d2d6c

View File

@ -4578,6 +4578,16 @@ QgsRasterIdentifyResult QgsWmsProvider::identify( const QgsPoint & thePoint, Qgs
featureStoreList.append( featureStore );
delete coordinateTransform;
}
// It is suspicious if we guessed feature types from GML but could not get
// features from it. Either we geuessed wrong schema or parsing features failed.
// Report it as error so that user can switch to another format in results dialog.
if ( xsdPart < 0 && !featureTypeNames.isEmpty() && featureStoreList.isEmpty() )
{
QgsError err = ERROR( tr( "Cannot identify" ) );
err.append( tr( "Result parsing failed. %1 feature types were guessed from gml (%2) but no features were parsed." ).arg( featureTypeNames.size() ).arg( featureTypeNames.join( "," ) ) );
QgsDebugMsg( "parsing GML error: " + err.message() );
return QgsRasterIdentifyResult( err );
}
results.insert( count, qVariantFromValue( featureStoreList ) );
}
}